@@ -49,6 +49,7 @@ import kotlinx.coroutines.Dispatchers
49
49
* @param interceptors optional delegates to call on query execution
50
50
* @param maxConnectionTtl number of milliseconds an object in this pool should be kept alive, negative values mean no aging out
51
51
* @param currentSchema optional search_path for the database
52
+ * @param socketPath path to unix domain socket file (on the local machine)
52
53
*
53
54
*/
54
55
data class ConnectionPoolConfiguration @JvmOverloads constructor(
@@ -74,7 +75,8 @@ data class ConnectionPoolConfiguration @JvmOverloads constructor(
74
75
val applicationName : String? = null ,
75
76
val interceptors : List <Supplier <QueryInterceptor >> = emptyList(),
76
77
val maxConnectionTtl : Long? = null ,
77
- val currentSchema : String? = null
78
+ val currentSchema : String? = null ,
79
+ val socketPath : String? = null
78
80
) {
79
81
init {
80
82
require(port > 0 ) { " port should be positive: $port " }
@@ -105,7 +107,8 @@ data class ConnectionPoolConfiguration @JvmOverloads constructor(
105
107
interceptors = interceptors,
106
108
executionContext = executionContext,
107
109
eventLoopGroup = eventLoopGroup,
108
- currentSchema = currentSchema
110
+ currentSchema = currentSchema,
111
+ socketPath = socketPath
109
112
)
110
113
111
114
val poolConfiguration = PoolConfiguration (
@@ -121,7 +124,7 @@ data class ConnectionPoolConfiguration @JvmOverloads constructor(
121
124
)
122
125
123
126
override fun toString () = """ ConnectionPoolConfiguration(host=$host , port=REDACTED,
124
- |database=$database ,username=REDACTED, password=REDACTED,
127
+ |database=$database ,username=REDACTED, password=REDACTED, socketPath=REDACTED,
125
128
|currentSchema=$currentSchema
126
129
|maxActiveConnections=$maxActiveConnections ,
127
130
|maxIdleTime=$maxIdleTime ,
@@ -135,7 +138,9 @@ data class ConnectionPoolConfiguration @JvmOverloads constructor(
135
138
|maximumMessageSize=$maximumMessageSize ,
136
139
|allocator=$allocator ,
137
140
|applicationName=$applicationName ,
138
- |interceptors=$interceptors , maxConnectionTtl=$maxConnectionTtl )""" .trimMargin()
141
+ |interceptors=$interceptors ,
142
+ |maxConnectionTtl=$maxConnectionTtl
143
+ |)""" .trimMargin()
139
144
}
140
145
141
146
/* *
@@ -166,7 +171,8 @@ data class ConnectionPoolConfigurationBuilder @JvmOverloads constructor(
166
171
var applicationName : String? = null ,
167
172
var interceptors : MutableList <Supplier <QueryInterceptor >> = mutableListOf<Supplier <QueryInterceptor >>(),
168
173
var maxConnectionTtl : Long? = null ,
169
- var currentSchema : String? = null
174
+ var currentSchema : String? = null ,
175
+ var socketPath : String? = null
170
176
) {
171
177
fun build (): ConnectionPoolConfiguration = ConnectionPoolConfiguration (
172
178
host = host,
@@ -190,6 +196,7 @@ data class ConnectionPoolConfigurationBuilder @JvmOverloads constructor(
190
196
allocator = allocator,
191
197
applicationName = applicationName,
192
198
interceptors = interceptors,
193
- currentSchema = currentSchema
199
+ currentSchema = currentSchema,
200
+ socketPath = socketPath
194
201
)
195
202
}
0 commit comments