Skip to main content
Deno 2 is finally here 🎉️
Learn more
Extremely Popular
Go to Latest
function templateStringToQuery
import { templateStringToQuery } from "https://deno.land/x/postgres@v0.19.0/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