slonik
Advanced tools
Comparing version 8.2.1 to 8.3.0
@@ -24,2 +24,7 @@ "use strict"; | ||
const connection = await pool.connect(); | ||
if (clientConfiguration.onConnect) { | ||
await clientConfiguration.onConnect(connection); | ||
} | ||
return (0, _bindPoolConnection.default)(parentLog, pool, connection, clientConfiguration); | ||
@@ -26,0 +31,0 @@ }, |
@@ -73,2 +73,7 @@ "use strict"; | ||
}); | ||
if (clientConfiguration.onConnect) { | ||
await clientConfiguration.onConnect(connection); | ||
} | ||
return (0, _bindSingleConnection.default)(connectionLog, pool, connection, clientConfiguration); | ||
@@ -75,0 +80,0 @@ }; |
@@ -93,3 +93,3 @@ { | ||
}, | ||
"version": "8.2.1" | ||
"version": "8.3.0" | ||
} |
@@ -110,4 +110,9 @@ <a name="slonik"></a> | ||
/** | ||
* @property interceptors An array of [Slonik interceptors](https://github.com/gajus/slonik#slonik-interceptors). | ||
* @property onConnect A new connection handler. Executed after a connection is established, but before allowing the connection to be used by any clients. | ||
*/ | ||
type ClientConfigurationType = {| | ||
+interceptors?: $ReadOnlyArray<InterceptorType> | ||
+interceptors?: $ReadOnlyArray<InterceptorType>, | ||
+onConnect?: (connection: DatabaseConnectionType) => MaybePromiseType<void> | ||
|}; | ||
@@ -114,0 +119,0 @@ |
@@ -38,2 +38,6 @@ // @flow | ||
if (clientConfiguration.onConnect) { | ||
await clientConfiguration.onConnect(connection); | ||
} | ||
return bindPoolConnection(parentLog, pool, connection, clientConfiguration); | ||
@@ -40,0 +44,0 @@ }, |
@@ -81,3 +81,7 @@ // @flow | ||
if (clientConfiguration.onConnect) { | ||
await clientConfiguration.onConnect(connection); | ||
} | ||
return bindSingleConnection(connectionLog, pool, connection, clientConfiguration); | ||
}; |
@@ -15,2 +15,4 @@ // @flow | ||
type MaybePromiseType<T> = T | Promise<T>; | ||
type FieldType = {| | ||
@@ -41,4 +43,9 @@ +columnID: number, | ||
/** | ||
* @property interceptors An array of [Slonik interceptors](https://github.com/gajus/slonik#slonik-interceptors). | ||
* @property onConnect A new connection handler. Executed after a connection is established, but before allowing the connection to be used by any clients. | ||
*/ | ||
export type ClientConfigurationType = {| | ||
+interceptors?: $ReadOnlyArray<InterceptorType> | ||
+interceptors?: $ReadOnlyArray<InterceptorType>, | ||
+onConnect?: (connection: DatabaseConnectionType) => MaybePromiseType<void> | ||
|}; | ||
@@ -45,0 +52,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
229996
2533
751