Skip to content

Global Options

These options are available on every dbsh command.

Options

OptionShortDescription
--environment <NAME>-eTarget environment (default: local)
--provider <NAME>-pDatabase provider: postgresql, sqlserver, mysql, sqlite
--connection-string <CONN>-cOverride connection string
--base-path <PATH>-CPath to the repository root (config base)
--in-memory-iForce offline in-memory mode (no database)
--yes-ySkip interactive confirmation prompts
--no-colorDisable colored output
--json-jEmit machine-readable JSON
--verbose-vShow detailed informational output
--module <NAME>-mModule name (subfolder under Database/Migrations/)
--help-hShow help
--versionShow version

Examples

bash
# Use a specific environment
dbsh migrate --environment production

# Override the provider
dbsh migrate -p sqlserver -c "Server=...;Database=...;..."

# Offline mode
dbsh plan --in-memory

# CI mode (no prompts, JSON output)
dbsh migrate --environment development --yes --json

# From a different repository root
dbsh validate --base-path /path/to/other/repo

Environment variable expansion

All ${VAR} tokens in configuration files are expanded from environment variables. This works with any environment variable, not just DB_CONNECTION_STRING.

json
{
  "database": {
    "connectionString": "${MY_APP_DATABASE_URL}"
  }
}

Released under the MIT License.