The following SQL in the file select-employees.sql
:
SELECT
employeeNumber,
lastName,
firstName
FROM
employees
WHERE
firstName LIKE 'a%'
Can be executed using the generated code:
//...
const result = await selectEmployees(conn);
console.log("result=", result);
SELECT
employeeNumber,
lastName,
firstName
FROM
employees
WHERE
firstName LIKE :nameLike
//...
const result = await selectEmployees(conn, {
nameLike: 'a%'
});
console.log("result=", result);
result= [
{ employeeNumber: 1143, lastName: 'Bow', firstName: 'Anthony' },
{ employeeNumber: 1611, lastName: 'Fixter', firstName: 'Andy' }
]