mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
e952ae20a8
- Also adds metrics for min and max pool size - Metrics for free/used connections. - Metrics for pending and current acquires fixes: #705
21 lines
527 B
JavaScript
21 lines
527 B
JavaScript
'use strict';
|
|
|
|
const knex = require('knex');
|
|
|
|
module.exports.createDb = function({ db, databaseSchema, getLogger }) {
|
|
const logger = getLogger('db-pool.js');
|
|
return knex({
|
|
client: 'pg',
|
|
version: db.version,
|
|
connection: db,
|
|
pool: db.pool,
|
|
searchPath: databaseSchema,
|
|
log: {
|
|
debug: msg => logger.debug(msg),
|
|
info: msg => logger.info(msg),
|
|
warn: msg => logger.warn(msg),
|
|
error: msg => logger.error(msg),
|
|
},
|
|
});
|
|
};
|