Waddler toSQL

This guide assumes familiarity with:

.toSQL() prepares and prints you SQL query as { query: string, params: any[] }:

console.log(sql`select * from users`.toSQL());
console.log(sql`select * from users where id = ${10}`.toSQL());
{
  query: "select * from users",
  params: [],
}
{
  query: "select * from users where id = $1",
  params: [ 10 ],
}