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

Usage

import { Pool } from "https://deno.land/x/postgres/mod.ts";
import {
  Fab,
  PostgresCompiler,
  PostgresExecutor,
} from "https://deno.land/x/fab/mod.ts";

const pool = new Pool(url, 20);
const executor = new PostgresExecutor(pool);
const compiler = () => new PostgresCompiler();
const fab = new Fab({ executor, compiler });

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

const user = await fab
  .selectFrom<User>("users")
  .select("*")
  .where("id", "=", 1)
  .first(); // User | null

console.log(user);

Future

  • Schema
  • Interface generation
  • Migrations