@@ -208,7 +208,7 @@ var mysql = require('mysql');
208
208
var pool = mysql .createPool ({
209
209
host : ' example.org' ,
210
210
user : ' bob' ,
211
- password : ' secret'
211
+ password : ' secret' ,
212
212
});
213
213
214
214
pool .getConnection (function (err , connection ) {
@@ -222,7 +222,7 @@ you can listen to the `connection` event.
222
222
``` js
223
223
pool .on (' connection' , function (err , connection ) {
224
224
connection .query (' SET SESSION auto_increment_increment=1' )
225
- })
225
+ });
226
226
```
227
227
228
228
When you are done with a connection, just call ` connection.end() ` and the
@@ -300,7 +300,7 @@ poolCluster.getConnection('SLAVE*', 'ORDER', function (err, connection) {});
300
300
// of namespace : of(pattern, selector)
301
301
poolCluster .of (' *' ).getConnection (function (err , connection ) {});
302
302
303
- var pool = poolCluster .of (' SLAVE*' , ' RANDOM' )
303
+ var pool = poolCluster .of (' SLAVE*' , ' RANDOM' );
304
304
pool .getConnection (function (err , connection ) {});
305
305
pool .getConnection (function (err , connection ) {});
306
306
@@ -320,7 +320,7 @@ poolCluster.end();
320
320
``` js
321
321
var clusterConfig = {
322
322
removeNodeErrorCount: 1 , // Remove the node immediately when connection fails.
323
- defaultSelector: ' ORDER'
323
+ defaultSelector: ' ORDER' ,
324
324
};
325
325
326
326
var poolCluster = mysql .createPoolCluster (clusterConfig);
@@ -683,7 +683,7 @@ connection.query(options, function(err, results) {
683
683
table1_fieldA: '...',
684
684
table1_fieldB: '...',
685
685
table2_fieldA: '...',
686
- table2_fieldB: '...'
686
+ table2_fieldB: '...',
687
687
}, ...]
688
688
*/
689
689
});
@@ -831,7 +831,7 @@ Or on the query level:
831
831
var options = {sql: ' ...' , typeCast: false };
832
832
var query = connection .query (options, function (err , results ) {
833
833
834
- }):
834
+ });
835
835
```
836
836
837
837
You can also pass a function and handle type casting yourself. You're given some
@@ -848,7 +848,7 @@ connection.query({
848
848
}
849
849
return next ();
850
850
}
851
- })
851
+ });
852
852
```
853
853
854
854
If you need a buffer there's also a ` .buffer() ` function and also a ` .geometry() ` one
@@ -869,7 +869,7 @@ prepend the flag with a minus sign. To add a flag that is not in the default lis
869
869
The next example blacklists FOUND_ROWS flag from default connection flags.
870
870
871
871
``` js
872
- var connection = mysql .createConnection (" mysql://localhost/test?flags=-FOUND_ROWS" )
872
+ var connection = mysql .createConnection (" mysql://localhost/test?flags=-FOUND_ROWS" );
873
873
```
874
874
875
875
### Default Flags
0 commit comments