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/config/database.ts
Théo LUDWIG 4add77856e
All checks were successful
Chromatic / chromatic (push) Successful in 2m58s
CI / ci (push) Successful in 4m43s
CI / commitlint (push) Successful in 15s
chore: try Adonis Tuyau
2024-08-16 01:50:11 +01:00

39 lines
958 B
TypeScript

import env from "#start/env.ts"
import app from "@adonisjs/core/services/app"
import { defineConfig } from "@adonisjs/lucid"
const databaseConfig = defineConfig({
prettyPrintDebugQueries: !app.inProduction,
connection: app.inTest ? "sqlite" : "postgres",
connections: {
postgres: {
debug: app.inDev,
client: "pg",
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"],
},
},
sqlite: {
client: "better-sqlite3",
connection: {
filename: ":memory:",
},
useNullAsDefault: true,
migrations: {
naturalSort: true,
paths: ["database/migrations"],
},
},
},
})
export default databaseConfig