summaryrefslogtreecommitdiff
path: root/db/db.ts
blob: 4a51d8707ea1ee39c734a2d57bbcc6e0648065b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { drizzle } from 'drizzle-orm/node-postgres';
import { Pool } from 'pg';
import * as schema from './schema'; 

const pool = new Pool({
  connectionString: process.env.DATABASE_URL as string,
  // connectionString: "postgresql://dts:dujinDTS2@localhost:5432/evcp",
  max: Number(process.env.DB_POOL_MAX) || 4,
});

const db = drizzle(pool, { schema });


export default db;