You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever the pool establishes a new client connection to the PostgreSQL backend it will emit the `connect` event with the newly connected client. This presents an opportunity for you to run setup commands on a client.
235
+
Whenever the pool establishes a new client connection to the PostgreSQL backend it will emit the `connect` event with the newly connected client.
236
236
237
-
```js
238
-
constpool=newPool()
239
-
pool.on('connect', (client) => {
240
-
client.query('SET DATESTYLE = iso, mdy')
241
-
})
242
-
```
237
+
<Alert>
238
+
The event listener does not wait for promises or async functions. If you want to run setup commands on each new client, use the `onConnect` option. (See documentation above.)
0 commit comments