mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-11 17:29:48 +02:00
Modify the application to use an in-memory storage solution, replacing the PostgreSQL database connection and data purging logic. This change impacts session management and data operations, introducing a fallback mechanism for when the database is unavailable. Replit-Commit-Author: Agent Replit-Commit-Session-Id: a388004f-01c5-42b1-b1d1-f18daf8bdd0c Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/a388004f-01c5-42b1-b1d1-f18daf8bdd0c/ekgWmFH
23 lines
670 B
TypeScript
23 lines
670 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?",
|
|
);
|
|
}
|
|
|
|
// Configuration de connexion avec support Unix socket pour PostgreSQL local
|
|
const connectionConfig = {
|
|
user: process.env.PGUSER,
|
|
password: process.env.PGPASSWORD,
|
|
database: process.env.PGDATABASE,
|
|
host: '/home/runner/postgres_data/socket',
|
|
port: 5432,
|
|
ssl: false // Désactiver SSL pour PostgreSQL local
|
|
};
|
|
|
|
export const pool = new Pool(connectionConfig);
|
|
|
|
export const db = drizzle(pool, { schema }); |