Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/windmill/pg.ts>pgClient

Windmill deno client (separated from the main repo because most of the code is auto-generated from the openapi and not worth committing)
Go to Latest
function pgClient
import { pgClient } from "https://deno.land/x/windmill@v1.52.0/pg.ts";

deno-postgres client API is very flexible: https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient

Examples

// Static query

const { rows } = await pgClient(db).queryObject(
  "SELECT ID, NAME FROM CLIENTS"
);

// Prepared Statements

const { rows } = await pgClient(db).queryObject`SELECT ID, NAME FROM CLIENTS WHERE ID = ${id}`;

Parameters

db: Resource<"postgresql">

the PostgreSQL resource to generate the client for