feat(config): add database configuration layer with backend detection

Add AppConfig loaded from .env via dotenvy. DATABASE_URL prefix
determines the backend (sqlite:// → SQLite, postgresql:// → PostgreSQL).
ConfigError via thiserror gives clear messages on missing or unknown URLs.
Server logs the chosen backend at startup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-15 19:44:55 +02:00
parent 18134d6f4b
commit b6d1e22d25
7 changed files with 141 additions and 1 deletions

7
Cargo.lock generated
View File

@@ -315,6 +315,12 @@ dependencies = [
"syn",
]
[[package]]
name = "dotenvy"
version = "0.15.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b"
[[package]]
name = "drain_filter_polyfill"
version = "0.1.3"
@@ -1590,6 +1596,7 @@ version = "0.1.0"
dependencies = [
"axum",
"console_error_panic_hook",
"dotenvy",
"leptos",
"leptos_axum",
"leptos_meta",