import { Pool } from "pg"; const { PGHOST, PGPORT, PGDATABASE, PGUSER, PGPASSWORD } = process.env; const pool = new Pool({ user: PGUSER, host: PGHOST, database: PGDATABASE, password: PGPASSWORD, port: Number(PGPORT) || undefined }); const query = async (query: string) => await pool.query(query); const end = () => pool.end(); module.exports = { query, end };