import pg from "pg";

if (!process.env.DATABASE_URL) {
  throw new Error("[startup] DATABASE_URL environment variable is required but not set.");
}
if (!process.env.USERS_DATABASE_URL) {
  throw new Error("[startup] USERS_DATABASE_URL environment variable is required but not set.");
}

export const pool = new pg.Pool({ connectionString: process.env.DATABASE_URL });
export const usersPool = new pg.Pool({ connectionString: process.env.USERS_DATABASE_URL });