add bulk insert method
API :
connection.queryBulk(sql, values) -> Promise
sql: string | JSON SQL string or JSON object to supersede default connection options. When using JSON object, object must have a "sql" key. For instance, { dateStrings: true, sql: 'SELECT now()' }
|
values: array of array, or in case of having one parameter per row, a single array.
|
Returns a promise that :
resolves with a JSON object or with an Error.
For instance, when using an SQL string:
connection
|
.queryBulk("INSERT INTO myTable(col1, col2) values (?, ?)", [[1, 'john'], [2, 'jack']])
|
.then(rows => {
|
console.log(rows);
|
})
|
.catch(err => {
|
//handle error
|
});
|