2023-03-03 15:54:28 +00:00
|
|
|
/**
|
|
|
|
* Config source: https://git.io/JesV9
|
|
|
|
*
|
|
|
|
* Feel free to let us know via PR, if you find something broken in this config
|
|
|
|
* file.
|
|
|
|
*/
|
|
|
|
|
2024-03-14 19:25:27 +00:00
|
|
|
import env from '#start/env';
|
|
|
|
// import { DatabaseConfig } from "@adonisjs/lucid/database";
|
|
|
|
import { defineConfig } from "@adonisjs/lucid";
|
2023-03-03 15:54:28 +00:00
|
|
|
|
2024-03-14 19:25:27 +00:00
|
|
|
const databaseConfig = defineConfig({
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Connection
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| The primary connection for making database queries across the application
|
|
|
|
| You can use any key from the `connections` object defined in this same
|
|
|
|
| file.
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
connection: env.get('DB_CONNECTION'),
|
2023-03-03 15:54:28 +00:00
|
|
|
|
2024-03-14 19:25:27 +00:00
|
|
|
connections: {
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| PostgreSQL config
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Configuration for PostgreSQL database. Make sure to install the driver
|
|
|
|
| from npm when using this connection
|
|
|
|
|
|
|
|
|
| npm i pg
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
pg: {
|
|
|
|
client: 'pg',
|
|
|
|
connection: {
|
|
|
|
host: env.get('PG_HOST'),
|
|
|
|
port: env.get('PG_PORT'),
|
|
|
|
user: env.get('PG_USER'),
|
|
|
|
password: env.get('PG_PASSWORD', ''),
|
|
|
|
database: env.get('PG_DB_NAME'),
|
|
|
|
},
|
|
|
|
searchPath: ['gba', 'public'],
|
|
|
|
migrations: {
|
|
|
|
naturalSort: true,
|
|
|
|
},
|
|
|
|
healthCheck: false,
|
|
|
|
debug: false,
|
|
|
|
pool: { min: 1, max: 100 },
|
2023-03-03 15:54:28 +00:00
|
|
|
},
|
2024-03-14 19:25:27 +00:00
|
|
|
},
|
|
|
|
});
|
2023-03-03 15:54:28 +00:00
|
|
|
|
|
|
|
export default databaseConfig;
|