File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -290,15 +290,6 @@ pool.getConnection(function(err, connection) {
290
290
});
291
291
```
292
292
293
- If you need to set session variables on the connection before it gets used,
294
- you can listen to the ` connection ` event.
295
-
296
- ``` js
297
- pool .on (' connection' , function (connection ) {
298
- connection .query (' SET SESSION auto_increment_increment=1' )
299
- });
300
- ```
301
-
302
293
When you are done with a connection, just call ` connection.release() ` and the
303
294
connection will return to the pool, ready to be used again by someone else.
304
295
@@ -350,6 +341,18 @@ addition to those options pools accept a few extras:
350
341
351
342
## Pool events
352
343
344
+ ### connection
345
+
346
+ The pool will emit a ` connection ` event when a new connection is made within the pool.
347
+ If you need to set session variables on the connection before it gets used, you can
348
+ listen to the ` connection ` event.
349
+
350
+ ``` js
351
+ pool .on (' connection' , function (connection ) {
352
+ connection .query (' SET SESSION auto_increment_increment=1' )
353
+ });
354
+ ```
355
+
353
356
### enqueue
354
357
355
358
The pool will emit an ` enqueue ` event when a callback has been queued to wait for
You can’t perform that action at this time.
0 commit comments