Configuration
Typed TOML configuration, file discovery order, and environment overlay.
RustaSea reads typed configuration from TOML files in config/. The loader (rustasea_config::ConfigLoader) auto-discovers every config/*.toml:
app.tomlis always applied first, as the base layer.- Remaining files are merged in sorted order.
- The process environment is applied last — environment variables always win over files.
.env files are supported via dotenvy.
Environment overrides
Nested keys use the __ separator. SERVICES__POSTMARK__KEY sets [services.postmark].key.
Laravel-style single-underscore vars are applied by typed consumers where wired:
Config files
Key environment variables include APP_NAME, APP_ENV, APP_DEBUG, APP_URL, APP_KEY, APP_LOCALE, DATABASE_URL, DB_*, REDIS_*, QUEUE_CONNECTION, SESSION_*, MAIL_*, and BROADCAST_CONNECTION.
Database connections
rustasea-orm owns config-driven named connections, resolved lazily by ConnectionResolver. Both a legacy flat database.url and explicit [database.connections.<name>] tables are supported.
- Default switching —
[database].defaultnames the connection used byresolve(None); an explicit name overrides it. - Read/write split — add an optional
[database.connections.<name>.read](and/or.write) overlay to route reads to a replica. Omitted fields inherit the primary. - MongoDB — a connection with
driver = "mongodb"resolves to aDatabaseConnection::Mongohandle behind the opt-inmongodbfeature; without it, the connection resolves to a typedConnectionError::UnsupportedDriverrather than panicking.
Last updated Sep 22, 2026