import pg from 'pg';
export default ({ user, password, database, host, port }) => {
const pool = new pg.Pool({
user,
password,
database,
host,
port,
});
// We are adding queryRow for consistency
pool.queryRow = async (...args) => {
const res = await pool.query(...args);
return res.rows[0];
};
return pool;
};