mysql: ConnectionConfig.flags can be a string (#37722)

mysqljs/mysql documents connection flags to be a comma-separated string,
  although it also accepted an array of strings
sidorares/node-mysql2 only accepts a comma-separated string
This commit is contained in:
Trevor Robinson 2019-08-19 13:16:20 -05:00 committed by Sheetal Nandi
parent f25108e59f
commit 692bc8ab38
2 changed files with 3 additions and 1 deletions

View File

@ -557,7 +557,7 @@ export interface ConnectionConfig extends ConnectionOptions {
/**
* List of connection flags to use other than the default ones. It is also possible to blacklist default ones
*/
flags?: string[];
flags?: string | string[];
/**
* object with ssl parameters or a string containing name of ssl profile

View File

@ -431,3 +431,5 @@ connection = mysql.createConnection({debug: true});
connection = mysql.createConnection({debug: ['ComQueryPacket', 'RowDataPacket']});
connection = mysql.createConnection({dateStrings: ['DATE']});
connection = mysql.createConnection({dateStrings: true});
connection = mysql.createConnection({flags: '-FOUND_ROWS'});
connection = mysql.createConnection({flags: ['-FOUND_ROWS']});