const knex = require('knex');
const config = require('src/config/index.js');

const pool = knex({
  client: 'pg',
  connection: {
    user: config.database.user,
    password: config.database.password,
    host: config.database.host,
    port: config.database.port,
    database: config.database.dbname,
  },
  pool: {
    max: config.database.pool_max,
    min: config.database.pool_min,
  },
});

module.exports = pool;
