Some checks are pending
Automatisch Backend Tests / test (push) Waiting to run
Automatisch CI / linter (push) Waiting to run
Automatisch CI / start-backend-server (push) Waiting to run
Automatisch CI / start-backend-worker (push) Waiting to run
Automatisch CI / build-web (push) Waiting to run
Automatisch UI Tests / test (push) Waiting to run
34 lines
954 B
JavaScript
34 lines
954 B
JavaScript
import { knexSnakeCaseMappers } from 'objection';
|
|
import appConfig from './src/config/app.js';
|
|
import path, { join } from 'path';
|
|
import { fileURLToPath } from 'url';
|
|
|
|
const fileExtension = 'js';
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
const knexConfig = {
|
|
client: 'pg',
|
|
connection: {
|
|
host: appConfig.postgresHost,
|
|
port: appConfig.postgresPort,
|
|
user: appConfig.postgresUsername,
|
|
password: appConfig.postgresPassword,
|
|
database: appConfig.postgresDatabase,
|
|
ssl: appConfig.postgresEnableSsl,
|
|
},
|
|
asyncStackTraces: appConfig.isDev,
|
|
searchPath: [appConfig.postgresSchema],
|
|
pool: { min: 0, max: 20 },
|
|
migrations: {
|
|
directory: join(__dirname, '/src/db/migrations'),
|
|
extension: fileExtension,
|
|
loadExtensions: [`.${fileExtension}`],
|
|
},
|
|
seeds: {
|
|
directory: join(__dirname, '/src/db/seeds'),
|
|
},
|
|
...(appConfig.isTest ? knexSnakeCaseMappers() : {}),
|
|
};
|
|
|
|
export default knexConfig;
|