18 lines
405 B
TypeScript
18 lines
405 B
TypeScript
// @ts-ignore
|
|
import { Pool } from 'pg'
|
|
import { Kysely, PostgresDialect } from 'kysely'
|
|
import env from '../env.ts'
|
|
import type { DB } from '../../shared/types.db.ts'
|
|
|
|
const dialect = new PostgresDialect({
|
|
pool: new Pool({
|
|
database: env.PGDATABASE,
|
|
host: env.PGHOST,
|
|
password: env.PGPASSWORD,
|
|
user: env.PGUSER,
|
|
port: env.PGPORT,
|
|
}),
|
|
})
|
|
|
|
export default new Kysely<DB>({ dialect })
|