Skip to content

Latest commit

 

History

History
30 lines (24 loc) · 737 Bytes

readme.md

File metadata and controls

30 lines (24 loc) · 737 Bytes

Kysely Deno Postgres driver

usage

import { Pool } from "https://deno.land/x/[email protected]/mod.ts";
import { Kysely, Generated } from "https://esm.sh/[email protected]";
import { PostgresDialect } from "https://deno.land/x/kysely_postgres/mod.ts";

// Create a database pool with one connection.
const pool = new Pool(
  {
    database: "postgres",
    hostname: "localhost",
    user: "postgres",
    port: 54322,
    password: Deno.env.get("DB_PASSWORD"),
  },
  1
);

// You'd create one of these when you start your app.
const db = new Kysely<Database>({
  dialect: new PostgresDialect({ pool }),
});

Reference

Based on node driver for postgres https://github.com/koskimas/kysely/tree/master/src/dialect/postgres