Repository
Current version released
2 years ago
sqlf
Fast pgSQL generation for Deno
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);