Details
-
New Feature
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Permits passing values in sql object to permit compatibility with mysql/mysql2, permitting compatibility with sql-template-strings at the same time.
standard API is using :
connection.query('SELECT ? as a', ['myValue']) |
.then(rows => {
|
console.log(rows); //[ { 'a': myValue' }, meta: [ ... ] ] |
})
|
.catch(...) |
or sql object:
connection.query({sql:'SELECT ? as a'}, ['myValue']) |
.then(rows => {
|
console.log(rows); //[ { 'a': myValue' }, meta: [ ... ] ] |
})
|
.catch(...) |
Using sql object, value can be given as 'values' entry:
connection.query({sql:'SELECT ? as a', value: ['myValue']}) |
.then(rows => {
|
console.log(rows); //[ { 'a': myValue' }, meta: [ ... ] ] |
})
|
.catch(...) |