import { Kysely, PostgresDialect } from "kysely"; import { Pool } from "pg"; import { connectionConfig } from "../../database"; import type { DB } from "../../generated/db"; const db = new Kysely({ dialect: new PostgresDialect({ pool: new Pool(connectionConfig), }), log(event) { if (event.level === "query") { // FIXME: Wire this up to the logging system console.log("SQL:", event.query.sql); console.log("Params:", event.query.parameters); } }, }); abstract class Hydrator { public db: Kysely; protected abstract table: string; constructor() { this.db = db; } } export { Hydrator, db };