feat(datamart): intial setup to datamart migrations

This commit is contained in:
2025-12-30 08:02:18 -06:00
parent 9531401e56
commit 9b5a75300a
6 changed files with 100 additions and 9 deletions

View File

@@ -0,0 +1,16 @@
import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";
const dbURL = `postgres://${process.env.DATABASE_USER}:${process.env.DATABASE_PASSWORD}@${process.env.DATABASE_HOST}:${process.env.DATABASE_PORT}/${process.env.DATABASE_DB}`;
const queryClient = postgres(dbURL, {
max: 10,
idle_timeout: 60,
connect_timeout: 30,
max_lifetime: 1000 * 6 * 5,
onnotice: (n) => {
console.info("PG notice: ", n.message);
},
});
export const db = drizzle({ client: queryClient });