Configuration
Database
Choose between PostgreSQL, Turso with Embedded Replicas, or SQLite
Implementation
- Database Migration: AtlasGo
- SQL generation: sqlc
- Database: PostgreSQL, Turso, or SQLite
Basic Flow
- Spin up the docker compose.
- Make changes to the
service-go-user/storage/schema.sql
file. - Run AtlasGo migration:
- Modify
service-go-user/storage/queries.sql
file. - Run sqlc to generate the SQL code:
Change Database
By default, the project uses local PostgreSQL. To change the database, you need to modify the following files:
scripts/atlas.sh
- change the database connection string and docker dev image.service-go-user/storage/sqlc.yaml
- change the database configuration.service-go-user/storage/schema.sql
- change the schema to match the new database.service-go-user/storage/queries.sql
- change the queries to match the new database.service-go-user/storage/storage.go
- change the database implementation by commenting/uncommenting the database provider.
Troubleshooting
- When running Docker on WSL2, the SQLite file may not work. In that case, you probably need to exclude it from volumes:
Need help?
Visit our discord server to ask any questions, make suggestions and give feedback :).
Was this page helpful?