[database] names the connection.
[database]
url = "postgres://localhost/acme_dev"
max_connections = 10 # optional
acquire_timeout_secs = 5 # optional
| Key | Description |
url | The connection URL. Required. |
max_connections | The pool ceiling. Default 10. |
acquire_timeout_secs | Seconds to wait for a pooled connection. Default 5. |
| Database | URL | Feature |
| PostgreSQL | postgres://user:pass@host/acme | postgres |
| MySQL / MariaDB | mysql://user:pass@host/acme | mysql |
| SQLite | sqlite://storage/database.db?mode=rwc | sqlite |
[dependencies]
lateritecmf = { version = "0.12", features = ["postgres"] }
# config/local.toml, git-ignored
[database]
url = "postgres://localhost/acme_dev"
LAT__DATABASE__URL="postgres://acme:secret@db.internal/acme" ./acme
lat admin list --database-url postgres://localhost/acme_dev
DATABASE_URL=postgres://localhost/acme_dev lat admin list
| Source | Order |
--database-url | First. |
DATABASE_URL | Second. |
database.url of the application found from the current directory upward | Last. |