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) {
290290});
291291```
292292
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-
302293When you are done with a connection, just call ` connection.release() ` and the
303294connection will return to the pool, ready to be used again by someone else.
304295
@@ -350,6 +341,18 @@ addition to those options pools accept a few extras:
350341
351342## Pool events
352343
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+
353356### enqueue
354357
355358The 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