initial commit
Build & Deployment / Build & Deploy (push) Failing after 5s

This commit is contained in:
Raul Lugo
2026-08-10 17:55:26 +02:00
parent 6429ed3fa3
commit 4ced446c9c
74 changed files with 9242 additions and 30 deletions
+25
View File
@@ -0,0 +1,25 @@
import { Kysely, PostgresDialect } from "kysely";
import { Pool } from "pg";
import { getDatabaseUrl } from "@/lib/config";
import type { Database } from "@/lib/db/types";
declare global {
var __weddingDb: Kysely<Database> | undefined;
}
function createDatabase() {
return new Kysely<Database>({
dialect: new PostgresDialect({
pool: new Pool({
connectionString: getDatabaseUrl(),
}),
}),
});
}
export const db = globalThis.__weddingDb ?? createDatabase();
if (process.env.NODE_ENV !== "production") {
globalThis.__weddingDb = db;
}