zsnmwyZ

```ts import { pgSql, type Resource, } from "https://deno.land/x/windmill@v1.108.1/mod.ts"; //P

import {
  pgSql,
  type Resource,
} from "https://deno.land/x/windmill@v1.108.1/mod.ts";

//PG parameterized statement. No SQL injection is possible.
export async function main(
  db: Resource<"postgresql"> = "$res:f/examples/demodb"
) {
  console.log(db)
  const query = await pgSql(
    db,
  )`SELECT VERSION()`;
  return query.rows;

}

Windmill integrates with
https://deno.land/x/postgres@v0.17.0
.
https://github.com/windmill-labs/windmill-deno-client/blob/07ffeea2ac7ff7fc061a4a5bd90e5b48bf6e461f/pg.ts#L4-L30
GitHub
Windmill deno client (separated from the main repo because most of the code is auto-generated from the openapi and not worth committing) - windmill-deno-client/pg.ts at 07ffeea2ac7ff7fc061a4a5bd90...
windmill-deno-client/pg.ts at 07ffeea2ac7ff7fc061a4a5bd90e5b48bf6e4...
Was this page helpful?