Waddler toSQL

This guide assumes familiarity with:

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

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