feat(lstv2 move): moved lstv2 into this app to keep them combined and easier to maintain
This commit is contained in:
22
lstV2/database/dbclient.ts
Normal file
22
lstV2/database/dbclient.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { drizzle } from "drizzle-orm/postgres-js";
|
||||
import postgres from "postgres";
|
||||
import dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
const database = process.env.DATABASE_URL || "";
|
||||
|
||||
const queryClient = postgres(database, {
|
||||
max: 10,
|
||||
idle_timeout: 60,
|
||||
connect_timeout: 10,
|
||||
max_lifetime: 1000 * 60 * 5,
|
||||
onnotice: (notice) => {
|
||||
console.log("PG NOTICE:", notice.message);
|
||||
},
|
||||
// debug: (...args) => {
|
||||
// console.log("QUERY DEBUG:", ...args);
|
||||
// },
|
||||
});
|
||||
|
||||
export const db = drizzle({ client: queryClient });
|
||||
Reference in New Issue
Block a user