mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-12 01:39:58 +02:00
Migrates from Neon serverless to local PostgreSQL, fixes timestamp comparisons, and applies Node.js 18 compatibility fixes. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 91318273-c764-4fd4-be04-bdc12c38af32 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/142044c4-d937-4abb-ae50-83d9764cfb4d.jpg
17 lines
437 B
TypeScript
17 lines
437 B
TypeScript
import { Pool } from 'pg';
|
|
import { drizzle } from 'drizzle-orm/node-postgres';
|
|
import * as schema from "@shared/schema";
|
|
|
|
if (!process.env.DATABASE_URL) {
|
|
throw new Error(
|
|
"DATABASE_URL must be set. Did you forget to provision a database?",
|
|
);
|
|
}
|
|
|
|
export const pool = new Pool({
|
|
connectionString: process.env.DATABASE_URL,
|
|
// Configuration pour PostgreSQL local
|
|
ssl: false
|
|
});
|
|
|
|
export const db = drizzle(pool, { schema }); |