This repository has been archived by the owner on Mar 3, 2022. It is now read-only.
Support for query parameters
Parameters are now supported and uses positional parameters that are marked with a question mark (?) instead of named parameters. Here is an example:
let command = `
select * from account
where
firstname = ?
and id = ?
`;
let parameters = [ 'Bob', 123 ];
db.query(command, parameters)
.then(function(results) {
console.log(results[0]);
},
function(error) {
console.error(error);
});