2018-06-26 16:59:53 +00:00
|
|
|
const pg = require('pg')
|
2018-07-13 05:30:54 +00:00
|
|
|
const config = require('@config/index')
|
2018-06-26 16:59:53 +00:00
|
|
|
|
|
|
|
const pool = new pg.Pool({
|
|
|
|
user: config.database.user,
|
|
|
|
password: config.database.pass || null,
|
|
|
|
host: config.database.host,
|
|
|
|
port: config.database.port,
|
2018-08-25 13:13:36 +00:00
|
|
|
max: 20,
|
2018-06-26 16:59:53 +00:00
|
|
|
database: config.database.dbname
|
|
|
|
})
|
|
|
|
|
2018-07-13 05:30:54 +00:00
|
|
|
module.exports = pool
|