modules/0-ui

This commit is contained in:
Lucas Tettamanti
2026-01-15 22:53:37 -03:00
parent ea62385e3d
commit 98e3d78e3d
17 changed files with 17 additions and 23 deletions

View File

@@ -1,15 +0,0 @@
import pg from "pg";
const { Pool } = pg;
export const pool = new Pool({
connectionString: process.env.DATABASE_URL,
max: parseInt(process.env.PG_POOL_MAX || "10", 10),
idleTimeoutMillis: parseInt(process.env.PG_IDLE_TIMEOUT_MS || "30000", 10),
connectionTimeoutMillis: parseInt(process.env.PG_CONN_TIMEOUT_MS || "5000", 10),
});
pool.on("error", (err) => {
console.error("[pg pool] unexpected error:", err);
});

View File

@@ -1,4 +1,4 @@
import { pool } from "./pool.js";
import { pool } from "../../shared/db/pool.js";
export async function ensureTenant({ key, name }) {
const q = `