mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-28 00:06:53 +01:00
20 lines
357 B
JavaScript
20 lines
357 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;
|
|
};
|