Database drivers

Garvan supports five backends out of the box. Switching between them is a matter of changing DATABASE_TYPE in .env — the same model/controller/service code keeps working.

MySQL

Backed by mysqlcppconn. Connection options live in DATABASE_URL:

DATABASE_TYPE=mysql
DATABASE_URL="mysql://user:pass@127.0.0.1:3306/dbname"

PostgreSQL

Backed by libpqxx. Supports SSL via ?sslmode=require.

DATABASE_TYPE=postgres
DATABASE_URL="postgres://user:pass@127.0.0.1:5432/dbname?sslmode=disable"

MongoDB

Backed by mongocxx. Queries are compiled to commands rather than SQL.

DATABASE_TYPE=mongodb
DATABASE_URL="mongodb://user:pass@127.0.0.1:27017/dbname"

MonetDB

Backed by libmapi. Useful for analytical workloads on the same model layer.

DATABASE_TYPE=monetdb
DATABASE_URL="monetdb://user:pass@127.0.0.1:50000/dbname"

SQLite

Backed by libsqlite3. Great for development and small deployments.

DATABASE_TYPE=sqlite
DATABASE_URL="sqlite:db/database.sqlite3"