update to support postgresql and add godocs
This commit is contained in:
19
README.md
19
README.md
@@ -114,6 +114,25 @@ Create a new up/down migration file with this command
|
||||
goose -dir db/migrations sqlite3 ./db.sqlite3 create init sql
|
||||
```
|
||||
|
||||
#### Database Configuration
|
||||
By default the app uses SQLite and creates/opens `db.sqlite3`. You can opt into PostgreSQL
|
||||
by setting environment variables:
|
||||
|
||||
- `DB_DRIVER`: `sqlite` (default) or `postgres`
|
||||
- `DB_URL`: SQLite file path/DSN or PostgreSQL DSN
|
||||
|
||||
Examples:
|
||||
```shell
|
||||
# SQLite (default)
|
||||
DB_DRIVER=sqlite DB_URL=./db.sqlite3
|
||||
|
||||
# PostgreSQL
|
||||
DB_DRIVER=postgres DB_URL=postgres://user:pass@localhost:5432/vctp?sslmode=disable
|
||||
```
|
||||
|
||||
PostgreSQL migrations live in `db/migrations_postgres`, while SQLite migrations remain in
|
||||
`db/migrations`.
|
||||
|
||||
### Dist
|
||||
|
||||
This is where your assets live. Any Javascript, images, or styling needs to go in the
|
||||
|
||||
Reference in New Issue
Block a user