12 lines
333 B
TypeScript
12 lines
333 B
TypeScript
|
|
import { drizzle } from "drizzle-orm/node-postgres";
|
||
|
|
import { Pool } from "pg";
|
||
|
|
import * as schema from "./schema/index.js";
|
||
|
|
|
||
|
|
const pool = new Pool({
|
||
|
|
connectionString: process.env.DATABASE_URL || "postgresql://sexy:sexy@localhost:5432/sexy",
|
||
|
|
max: 20,
|
||
|
|
});
|
||
|
|
|
||
|
|
export const db = drizzle(pool, { schema });
|
||
|
|
export type DB = typeof db;
|