common: initial database handling

Can be configured from the config file, and also using environment
options.

```toml
[database]
url = "postgresql://fc_ci:password@localhost/fc_ci"
max_connections = 20
min_connections = 5
connect_timeout = 30
idle_timeout = 600
max_lifetime = 1800
```

We'll want to support SQlite in the future, and better secret handling
for database credentials. For now, this is workable.

---

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I36b4c1306511052a2748ca9d5d3429366a6a6964
This commit is contained in:
raf 2025-11-02 21:31:21 +03:00
commit 0e6d249e0f
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
6 changed files with 530 additions and 5 deletions

View file

@ -18,3 +18,7 @@ git2.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
clap.workspace = true
config.workspace = true
tempfile.workspace = true
toml.workspace = true
tokio.workspace = true