feat: use a function instead of arrow for new_client, martin will be happy
This commit is contained in:
parent
fda268a033
commit
1390039930
@ -7,17 +7,19 @@ const db_host = process.env.DB_HOST ?? "localhost";
|
|||||||
const db_port = parseInt(process.env.DB_PORT ?? "5432");
|
const db_port = parseInt(process.env.DB_PORT ?? "5432");
|
||||||
|
|
||||||
console.log("=== DB CONFIG ===");
|
console.log("=== DB CONFIG ===");
|
||||||
console.log(`DB_USER:\t\t${db_user}`);
|
console.log(`DB_USER:\t${db_user}`);
|
||||||
console.log(`DB_PASSWORD:\t${db_user}`);
|
console.log(`DB_PASSWORD:\t${db_user}`);
|
||||||
console.log(`DB_NAME:\t\t${db_name}`);
|
console.log(`DB_NAME:\t${db_name}`);
|
||||||
console.log(`DB_HOST:\t\t${db_host}`);
|
console.log(`DB_HOST:\t${db_host}`);
|
||||||
console.log(`DB_PORT:\t\t${db_port}`);
|
console.log(`DB_PORT:\t${db_port}`);
|
||||||
|
console.log("=== END DB CONFIG ===");
|
||||||
|
|
||||||
|
export function new_client() {
|
||||||
export const new_client = () => new pg.Client({
|
return new pg.Client({
|
||||||
user: db_user,
|
user: db_user,
|
||||||
password: db_password,
|
password: db_password,
|
||||||
database: db_name,
|
database: db_name,
|
||||||
host: db_host,
|
host: db_host,
|
||||||
port: db_port,
|
port: db_port,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user