All database configuration lives under the sql key in application.yaml. The provider auto-injects DatabaseConfig — no manual loading needed.
Config section: sql | Env prefix: ORI_SQL__ | Nested delimiter: __
url : postgresql+asyncpg://user:pass@localhost/mydb
export ORI_SQL__BACKEND__URL = postgresql + asyncpg :// user : pass @ localhost / mydb
export ORI_SQL__POOL__MIN_SIZE = 2
Key Type Default Env Var Description enabledboolTrueORI_SQL__ENABLEDEnable the database module backendDatabaseBackendConfigsqlite:///piccolina.dbORI_SQL__BACKEND__*Connection URL and driver poolDatabasePoolConfig(see below) ORI_SQL__POOL__*Connection pool settings operationsDatabaseOperationConfig(see below) ORI_SQL__OPERATIONS__*Operation settings outboxDatabaseOutboxConfig(see below) ORI_SQL__OUTBOX__*Outbox pattern settings migrationsDatabaseMigrationConfig(see below) ORI_SQL__MIGRATIONS__*Migration settings audit_hmac_keystr | NoneNoneORI_SQL__AUDIT_HMAC_KEYHMAC key for audit signing backendslist[NamedDatabaseConfig][]ORI_SQL__BACKENDSMulti-database backends
Key Type Default Env Var Description urlSecretStrrequired ORI_SQL__BACKEND__URLDatabase connection URL
Valid URL prefixes: sqlite, postgresql, postgres, mysql, mariadb, oracle, mssql, custom.
Key Type Default Env Var Description min_sizeint1ORI_SQL__POOL__MIN_SIZEMinimum pool connections max_sizeint10ORI_SQL__POOL__MAX_SIZEMaximum pool connections max_overflowint5ORI_SQL__POOL__MAX_OVERFLOWMax overflow connections recycleint3600ORI_SQL__POOL__RECYCLEConnection recycle time (seconds) timeoutfloat30.0ORI_SQL__POOL__TIMEOUTPool timeout (seconds) acquire_timeoutDuration30sORI_SQL__POOL__ACQUIRE_TIMEOUTConnection acquire timeout idle_timeoutDuration5mORI_SQL__POOL__IDLE_TIMEOUTIdle connection timeout max_lifetimeDuration1hORI_SQL__POOL__MAX_LIFETIMEMax connection lifetime
Key Type Default Env Var Description echoboolFalseORI_SQL__OPERATIONS__ECHOLog all SQL statements statement_timeoutDuration60sORI_SQL__OPERATIONS__STATEMENT_TIMEOUTMax query execution time
Key Type Default Env Var Description enabledboolTrueORI_SQL__OUTBOX__ENABLEDEnable outbox pattern poll_intervalDuration5sORI_SQL__OUTBOX__POLL_INTERVALOutbox poll interval batch_max_ageDuration30sORI_SQL__OUTBOX__BATCH_MAX_AGEMax age for outbox batches
Key Type Default Env Var Description lock_timeoutDuration30sORI_SQL__MIGRATIONS__LOCK_TIMEOUTMigration lock timeout
Key Type Default Env Var Description namestrrequired ORI_SQL__BACKENDS__0__NAMEUnique backend name backendDatabaseBackendConfigrequired ORI_SQL__BACKENDS__0__BACKEND__*Connection config primaryboolFalseORI_SQL__BACKENDS__0__PRIMARYPrimary backend (unnamed bindings) poolDatabasePoolConfigmin_size=2ORI_SQL__BACKENDS__0__POOL__*Per-backend pool settings migration_dirstr | NoneNoneORI_SQL__BACKENDS__0__MIGRATION_DIRAlembic dir for this backend
Key Type Default Description default_page_sizeint20Default pagination page size max_page_sizeint1000Maximum allowed page size default_cursor_sizeint20Default cursor pagination size
url : postgresql+asyncpg://user:password@localhost:5432/mydb
audit_hmac_key : "${AUDIT_HMAC_KEY}"
Environment override equivalent:
export ORI_SQL__BACKEND__URL = postgresql + asyncpg :// user : password @ localhost : 5432 / mydb
export ORI_SQL__POOL__MIN_SIZE = 5
export ORI_SQL__POOL__MAX_SIZE = 30
export ORI_SQL__AUDIT_HMAC_KEY = my-hmac-key
url : postgresql+asyncpg:///primary
url : postgresql+asyncpg:///reporting
migration_dir : migrations/reporting
In production, set ORI_SQL__BACKEND__URL via environment variable — never hardcode credentials in YAML. The production validator rejects common default passwords.