Database Settings
Database Configuration
Database Settings
database:
driver: "sqlite"
dsn: "./app.db?_pragma=journal_mode(WAL)"
The driver determines which database engine Conduit will use. The dsn is passed directly to the underlying driver without modification.
Supported Database Drivers
Conduit supports the following database engines:
- SQLite — file‑based or in‑memory SQLite
- Memory — in‑memory database for testing
- PostgreSQL
- MySQL / MariaDB
- SQL Server
Each driver accepts a DSN appropriate for that engine. Below are examples for each supported database.
SQLite Example
database:
driver: "sqlite"
dsn: "./app.db?_pragma=journal_mode(WAL)&_pragma=busy_timeout(5000)"
SQLite is the default driver used in Conduit’s example configuration. DSN parameters are passed directly to the SQLite engine.
Memory Example
database:
driver: "memory"
dsn: ""
The memory driver stores all data in RAM and is ideal for testing or ephemeral workloads.
PostgreSQL Example
database:
driver: "postgres"
dsn: "postgres://user:pass@localhost:5432/app"
Conduit uses the standard PostgreSQL DSN format. SSL, pooling, and advanced parameters can be added as needed.
MySQL / MariaDB Example
database:
driver: "mysql"
dsn: "user:pass@tcp(localhost:3306)/app?parseTime=true"
MySQL and MariaDB use the same DSN format.
The parseTime=true option is recommended for correct timestamp handling.
SQL Server Example
database:
driver: "sqlserver"
dsn: "sqlserver://user:pass@localhost:1433?database=app"
SQL Server uses the standard URL‑style DSN format. Additional parameters such as encryption or timeouts may be appended.
Notes
- All DSNs are passed directly to the underlying driver.
- No rewriting or normalization is performed.
- If the driver or DSN is invalid, Conduit will return a startup error.