Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

Support for query parameters

Compare
Choose a tag to compare
@mike-eason mike-eason released this 11 Jan 16:30

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);
});