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 }),
});
Based on node driver for postgres https://github.com/koskimas/kysely/tree/master/src/dialect/postgres