You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
serverpod_database should expose a natural way to get a database connection from config #5046
The serverpod_database package should expose a first-class API for obtaining a database connection directly from a Serverpod config (e.g., loading config/<runMode>.yaml and config/passwords.yaml, then constructing a pool manager and database session).
Background
Currently, tools/serverpod_cli/lib/src/migrations/cli_migration_runner.dart manually replicates this logic — loading config files, constructing a DatabaseProvider, creating a pool manager, and wiring up a bespoke _CliDatabaseSession to work around the circular Session ↔ Database construction dependency — in order to apply pending migrations from outside the pod.
This logic is non-trivial and error-prone to duplicate. Exposing it as a proper API in serverpod_database would allow tooling (CLI, test utilities, etc.) to obtain a database connection in a clean, maintainable way without reimplementing internals.
Activity