import { SubscriptionTable } from "./subscription" import pg from "pg" const { Pool } = 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 let db = new Kysely({ dialect, }) export function resetDbInstance() { db = new Kysely({ dialect, }) }