This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
wikipedia-game-solver/apps/api/src/config/database.ts

28 lines
704 B
TypeScript
Raw Normal View History

2024-08-09 23:51:41 +02:00
import env from "#start/env.js"
import app from "@adonisjs/core/services/app"
2024-08-09 23:51:41 +02:00
import { defineConfig } from "@adonisjs/lucid"
const databaseConfig = defineConfig({
prettyPrintDebugQueries: !app.inProduction,
connection: "postgres",
2024-08-09 23:51:41 +02:00
connections: {
postgres: {
debug: !app.inProduction,
client: "pg",
2024-08-09 23:51:41 +02:00
connection: {
host: env.get("DATABASE_HOST"),
port: env.get("DATABASE_PORT"),
user: env.get("DATABASE_USER"),
password: env.get("DATABASE_PASSWORD"),
database: env.get("DATABASE_NAME"),
},
migrations: {
naturalSort: true,
paths: ["database/migrations"],
},
},
},
})
export default databaseConfig