2024-01-13 22:22:03 -07:00
|
|
|
import { drizzle } from "drizzle-orm/postgres-js";
|
|
|
|
import postgres from "postgres";
|
2023-12-11 22:58:49 -07:00
|
|
|
import * as schema from "./schema.server";
|
2023-12-15 10:44:20 -07:00
|
|
|
import "dotenv/config";
|
2023-04-20 04:20:00 -06:00
|
|
|
|
2024-01-13 22:22:03 -07:00
|
|
|
const queryClient = postgres(process.env.DATABASE_URL!, {
|
|
|
|
idle_timeout: 20,
|
|
|
|
max_lifetime: 60 * 30,
|
|
|
|
});
|
|
|
|
export const db = drizzle(queryClient, { schema });
|