Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Database Internals

BookBoss uses SeaORM for database access. PostgreSQL, MySQL, MariaDB, and SQLite are all supported.

Environment Variables

The following environment variables are used by database-related just commands:

VariableUsed by
PGUSERjust create-database, just database
PGPASSWORDjust create-database, just database
PGDATABASEjust create-database, just database
PGADMINUSERjust create-database
PGADMINPASSWORDjust create-database
BOOKBOSS__DATABASE__DATABASE_URLMigrations, entity generation

Connection string format for BOOKBOSS__DATABASE__DATABASE_URL:

  • PostgreSQL: postgres://user:password@host:port/database
  • MySQL: mysql://user:password@host:port/database
  • SQLite: sqlite::/path/to/file or sqlite::memory:

Warning: Secrets must be encrypted with sops. Never commit plaintext credentials.

Migrations

Migrations run automatically on application startup. No manual steps are required.

Integration Tests

Integration tests for each backend run in Docker via Colima:

colima start
just postgres-integration-tests
just mysql-integration-tests
just mariadb-integration-tests
just sqlite-integration-tests
colima stop