Skip to content

feat: add env-driven config/CLI precedence and PK-less safety guards#4

Merged
nabroleonx merged 2 commits into
mainfrom
feat/hardening-env-config
Mar 3, 2026
Merged

feat: add env-driven config/CLI precedence and PK-less safety guards#4
nabroleonx merged 2 commits into
mainfrom
feat/hardening-env-config

Conversation

@nabroleonx

Copy link
Copy Markdown
Owner
  • Support database.url placeholders ${VAR} and ${VAR_FILE} in YAML config
  • Fail fast for missing env vars and unreadable _FILE targets
  • Add extract env defaults:
    • DATABASE_URL
    • DBSLICE_DEPTH
    • DBSLICE_DIRECTION
    • DBSLICE_OUTPUT_FORMAT
    • DBSLICE_ANONYMIZE
    • DBSLICE_REDACT_FIELDS
  • Enforce precedence: CLI > Env > Config
  • Allow init and inspect to fallback to DATABASE_URL when URL arg is omitted
  • Harden PK-less behavior:
    • error on PK-less seed tables
    • skip non-seed PK-less PK/FK fetch paths safely with warnings
  • Update docs for placeholder semantics, env formats, and precedence
  • Add unit/integration coverage for env resolution/fallback and PK-less safety

- Support `database.url` placeholders `${VAR}` and `${VAR_FILE}` in YAML config
- Fail fast for missing env vars and unreadable `_FILE` targets
- Add extract env defaults:
  - `DATABASE_URL`
  - `DBSLICE_DEPTH`
  - `DBSLICE_DIRECTION`
  - `DBSLICE_OUTPUT_FORMAT`
  - `DBSLICE_ANONYMIZE`
  - `DBSLICE_REDACT_FIELDS`
- Enforce precedence: `CLI > Env > Config`
- Allow `init` and `inspect` to fallback to `DATABASE_URL` when URL arg is omitted
- Harden PK-less behavior:
  - error on PK-less seed tables
  - skip non-seed PK-less PK/FK fetch paths safely with warnings
- Update docs for placeholder semantics, env formats, and precedence
- Add unit/integration coverage for env resolution/fallback and PK-less safety
@nabroleonx nabroleonx merged commit 895058c into main Mar 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant