Skip to main content
Module

x/windmill/mod.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.79.0/mod.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