Skip to content

Commit

Permalink
fix: add SQLite rather than Posgres from Render.com to avoid paying
Browse files Browse the repository at this point in the history
  • Loading branch information
jvondermarck committed Jul 27, 2024
1 parent 6d88b3a commit 7fe0db1
Show file tree
Hide file tree
Showing 5 changed files with 1,132 additions and 45 deletions.
9 changes: 7 additions & 2 deletions backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ HOST=localhost
LOG_LEVEL=info
APP_KEY=PKxPj7ZBKmNpX6AKnUhHYlsqYtzrBn06
NODE_ENV=development

# Required even for SQLite (but required for PostgreSQL)
DB_HOST=127.0.0.1
DB_PORT=5432
DB_USER=postgres
DB_USER=localhost
DB_PASSWORD=
DB_DATABASE=
DB_SSL=true
DB_SSL=true

# Required for SQLite
DB_DATABASE=./database.sqlite
32 changes: 23 additions & 9 deletions backend/config/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,39 @@ import env from '#start/env'
import { defineConfig } from '@adonisjs/lucid'

const dbConfig = defineConfig({
connection: 'postgres',
connection: 'sqlite',
// connection: 'postgres',
connections: {
postgres: {
client: 'postgres',
sqlite: {
client: 'sqlite',
connection: {
host: env.get('DB_HOST'),
port: env.get('DB_PORT'),
user: env.get('DB_USER'),
password: env.get('DB_PASSWORD'),
database: env.get('DB_DATABASE'),
ssl: env.get('DB_SSL'),
filename: env.get('DB_DATABASE'),
},
useNullAsDefault: true,
migrations: {
naturalSort: true,
paths: ['database/migrations'],
},
debug: true,
},
//postgres: {
// client: 'postgres',
// connection: {
// host: env.get('DB_HOST'),
// port: env.get('DB_PORT'),
// user: env.get('DB_USER'),
// password: env.get('DB_PASSWORD'),
// database: env.get('DB_DATABASE'),
// ssl: env.get('DB_SSL'),
// },
// migrations: {
// naturalSort: true,
// paths: ['database/migrations'],
// },
// debug: true,
//},
},
})

export default dbConfig

Binary file added backend/database.sqlite
Binary file not shown.
Loading

0 comments on commit 7fe0db1

Please sign in to comment.