feat(db): db stuff added in starting migration from old app

This commit is contained in:
2025-08-31 15:01:50 -05:00
parent f348e4e053
commit 2d5fbbbab0
11 changed files with 965 additions and 36 deletions

16
app/src/pkg/db/db.ts Normal file
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 * 60 * 5, // 5 min time out
onnotice: (notice) => {
console.log("PG notice: ", notice.message);
},
});
export const db = drizzle({ client: queryClient });