21 lines
379 B
TypeScript
21 lines
379 B
TypeScript
import { SubscriptionTable } from "./subscription"
|
|
import { Pool } from "pg"
|
|
|
|
export interface Database {
|
|
subscription: SubscriptionTable
|
|
}
|
|
|
|
import { Kysely, PostgresDialect } from "kysely"
|
|
import settings from "./settings"
|
|
|
|
const dialect = new PostgresDialect({
|
|
pool: new Pool({
|
|
...settings,
|
|
max: 10,
|
|
}),
|
|
})
|
|
|
|
export const db = new Kysely<Database>({
|
|
dialect,
|
|
})
|