Skip to content

dx(db): add VIX_DB environment variables with legacy ORM aliases #472

Description

@GaspardKirira

Summary

Align database configuration environment variables with the DB module name.

The DB module is separate from the ORM module, but the migration CLI still primarily uses VIX_ORM_* variables.

Current behavior

The migrator and vix orm integration use variables such as:

  • VIX_ORM_HOST;
  • VIX_ORM_USER;
  • VIX_ORM_PASS;
  • VIX_ORM_DB;
  • VIX_ORM_DIR;
  • VIX_ORM_TOOL.

The tool lookup already recognizes VIX_DB_TOOL, but the remaining configuration remains ORM-prefixed.

Expected behavior

New DB-specific environment variables must be supported while legacy ORM variables continue to work for backward compatibility.

Scope

  • Add VIX_DB_HOST.
  • Add VIX_DB_USER.
  • Add VIX_DB_PASSWORD.
  • Add VIX_DB_NAME.
  • Add VIX_DB_MIGRATIONS_DIR.
  • Standardize VIX_DB_TOOL.
  • Define precedence between flags, DB variables, and legacy ORM variables.
  • Update CLI help.
  • Add parsing tests.
  • Preserve legacy variables.

Suggested precedence

  1. Explicit CLI flag.
  2. VIX_DB_* variable.
  3. Legacy VIX_ORM_* variable.
  4. Default value.

Suggested files

  • modules/cli/src/commands/OrmCommand.cpp
  • modules/db/tools/migrator/MigratorCLI.cpp
  • modules/db/README.md
  • CLI tests.

Acceptance criteria

  • New VIX_DB_* variables work.
  • Legacy VIX_ORM_* variables still work.
  • CLI flags override environment variables.
  • DB variables override legacy ORM variables.
  • Help output documents the precedence.
  • Password values are not printed.
  • Existing command syntax remains compatible.

Non-goals

This issue does not include:

  • renaming vix orm;
  • removing legacy variables;
  • changing .env key names used by Config;
  • ORM configuration.

Suggested labels

  • scope:db
  • scope:cli
  • type:dx
  • devx
  • good first issue
  • status:ready

Metadata

Metadata

Assignees

No one assigned

    Labels

    devxDeveloper experience improvements: tooling, diagnostics, ergonomics, and workflow polish.good first issueGood for newcomersscope:cliCLI (vix run, vix dev, etc.)scope:dbDatabase driversstatus:readyIssue is fully specified and ready for implementationtype:dxDeveloper experience (CLI, errors, logs, UX)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions