1234567891011121314151617 |
- const pgp = require('pg-promise')();
- var PgInstanse;
- export const pgClient = function(){
- let pgConns = global.config['DATABASE_DBNAME']
-
- if(global.config['LOCAL']) {
- pgConns = `postgres://postgres:postgres@127.0.0.1:25432/postgres`
- }
-
- if(!PgInstanse){
-
- PgInstanse = pgp(pgConns);
- }
- return PgInstanse;
- }
|