Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
function templateStringToQuery
import { templateStringToQuery } from "https://deno.land/x/postgres@ls/query/query.ts";

This function transforms template string arguments into a query

["SELECT NAME FROM TABLE WHERE ID = ", " AND DATE < "]
// "SELECT NAME FROM TABLE WHERE ID = $1 AND DATE < $2"

Parameters

template: TemplateStringsArray
args: unknown[]
result_type: T