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

sqlf

Fast pgSQL generation for Deno

test deno doc deno module

import { Pool } from "https://deno.land/x/postgres/mod.ts";
import { PgClient } from "https://deno.land/x/sqlf/mod.ts";

const pool = new Pool("...");
const db = new PgClient(pool);

interface User {
  id: number;
  email: string;
}

const [user] = await db
  .selectFrom<User>("users")
  .select("*")
  .where("email", "=", "bob@example.com")
  .limit(1)
  .all();

console.log(user);