-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor @module/database to not read env vars at module level #116
Copy link
Copy link
Open
Description
Problem
@module/database reads DB_PASSWORD_FILE from process.env at module load time and throws if it's missing. This creates an implicit requirement: any package that depends on @module/database (directly or transitively) must have DB_PASSWORD_FILE set, even if it doesn't directly use the database connection.
This caused a startup crash in the auth server (fixed in #115), which depends on @module/database but had no DB_PASSWORD_FILE configured.
Suggestion
Make database configuration explicit — accept config/credentials as parameters during initialization rather than reading env vars at the module level. This way the consuming app controls where credentials come from and the dependency is visible, not hidden.
File
modules/server/database/src/pool/config.ts
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels