1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-01 00:08:27 +01:00
unleash.unleash/lib/db/db-pool.js
2016-12-27 21:03:50 +01:00

15 lines
341 B
JavaScript

'use strict';
const knex = require('knex');
module.exports.createDb = function ({ databaseUrl, poolMin = 2, poolMax = 20, databaseSchema = 'public' }) {
const db = knex({
client: 'pg',
connection: databaseUrl,
pool: { min: poolMin, max: poolMax },
searchPath: databaseSchema,
});
return db;
};