config/db.php defines the default connection and available drivers.
Default connection #
| Key |
Env Variable |
Description |
db.default |
DB_CONNECTION |
Connection name (default: sqlite) |
SQLite #
| Key |
Env Variable |
Default |
db.connections.sqlite.database |
DB_DATABASE |
storage/database.sqlite |
db.connections.sqlite.prefix |
- |
'' |
MySQL #
| Key |
Env Variable |
Default |
db.connections.mysql.host |
DB_HOST |
127.0.0.1 |
db.connections.mysql.port |
DB_PORT |
3306 |
db.connections.mysql.database |
DB_DATABASE |
velvetcms |
db.connections.mysql.username |
DB_USERNAME |
root |
db.connections.mysql.password |
DB_PASSWORD |
'' |
db.connections.mysql.charset |
- |
utf8mb4 |
db.connections.mysql.collation |
- |
utf8mb4_unicode_ci |
db.connections.mysql.prefix |
- |
'' |
PostgreSQL #
| Key |
Env Variable |
Default |
db.connections.pgsql.host |
DB_HOST |
127.0.0.1 |
db.connections.pgsql.port |
DB_PORT |
5432 |
db.connections.pgsql.database |
DB_DATABASE |
velvetcms |
db.connections.pgsql.username |
DB_USERNAME |
postgres |
db.connections.pgsql.password |
DB_PASSWORD |
'' |
db.connections.pgsql.charset |
- |
utf8 |
db.connections.pgsql.schema |
- |
public |
db.connections.pgsql.prefix |
- |
'' |
Tenancy #
If you use DB-per-tenant, put overrides in user/tenants/<tenant>/config/db.php and set TENANCY_TENANT for CLI commands.
TENANCY_TENANT=acme ./velvet migrate