You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
713 B
TypeScript
22 lines
713 B
TypeScript
import { Pool } from "pg";
|
|
import { Kysely, PostgresDialect } from "kysely";
|
|
import type Database from "./generated/Database";
|
|
|
|
export const pool = new Pool({
|
|
connectionString:
|
|
"postgres://neondb_owner:npg_sOVmj8vWq2zG@ep-withered-king-adiz9gpi-pooler.c-2.us-east-1.aws.neon.tech:5432/neondb?sslmode=require&channel_binding=true",
|
|
// channelBinding: require ?
|
|
});
|
|
|
|
const dialect = new PostgresDialect({
|
|
pool,
|
|
});
|
|
|
|
// Database interface is passed to Kysely's constructor, and from now on, Kysely
|
|
// knows your database structure.
|
|
// Dialect is passed to Kysely's constructor, and from now on, Kysely knows how
|
|
// to communicate with your database.
|
|
export const db = new Kysely<Database>({
|
|
dialect,
|
|
});
|