Centralize db connection logic

- So we can reintroduce some parallelism
- DB_CONNECTION was always sqlite:///... when unspecified, even if DB was set to mysql/postgres
- [#72550650]