Skip to content

Deprecate BaseURL in favor of explicit registry lists #561

Open

Description

@zeroshade

Follow-up from #545 (comment).

BaseURL predates registry configuration and has outlived its purpose. It overlaps with explicit registry lists and adds a precedence rule to every entry point. #551 adds an explicit, ordered registries list to every binding, which covers the same need:

Surface BaseURL form Replacement (from #551)
Go library dbc.WithBaseURL(url) dbc.WithRegistries([]dbc.Registry{{BaseURL: u}})
internal/api ClientConfig.BaseURL ClientConfig.Registries
C API DBC_OPTION_BASE_URL registry.<n>.url / DBC_OPTION_REGISTRY_COUNT
Rust ClientConfig::base_url ClientConfig::registries(...)
npm-wasm baseURL registries
CLI DBC_BASE_URL env var see below

Proposal

  1. Bindings (unreleased): remove baseURL from internal/api, the C API, Rust and npm-wasm before their first release, so they launch with a single way to choose registries. Removing it now costs nothing; after release it would need a deprecation cycle.
  2. Go library: mark dbc.WithBaseURL // Deprecated: in favor of WithRegistries, and remove it in a later release. It has been public API since v0.2.0.
  3. CLI: DBC_BASE_URL is the documented way to recover from a broken registry config: it overrides the global config.toml (TestInstallCmdDBCBaseURLOverridesGlobalConfig). Keep that ability, either by implementing DBC_BASE_URL on top of WithRegistries, or by replacing it with an env var that accepts a registry list, deprecating DBC_BASE_URL first.

Open questions

Activity

  1. added this to the 0.4.0 milestone on Dec 1, 2026
  2. eitsupi commented on Dec 4, 2026

    @eitsupi
    Member

    I think we can deprecate DBC_BASE_URL in 0.4.0, keeping it working with a warning, and remove it later without a replacement.

    The registry configuration now covers what it was used for. When this issue was opened, #360 already supported custom registries. Verification used Columnar's key unless skipped. Since then:

    It is not a complete escape hatch from a broken config, and I don't think we should keep it only for that:

    • A broken user config.toml still blocks registry operations with DBC_BASE_URL set. The override skips dbc.toml for search, info, and docs. 1
    • It was added as a plain override of the default URL. The unreleased feat(registry): configurable driver registries via TOML config #360 described using it for recovery. 1
    • Other package managers also stop on a broken config. uv and mise offer a separate --no-config option. 2 3 4

    Once it is removed, dbc should report an error if the variable is still nonempty, to avoid silently switching registries. Cargo also rejects the removed registry.index setting. 2

    The findings above come from an investigation by a coding agent.

    Footnotes

    1. dbc: newDBCClient in cmd/dbc/main.go, applyProjectRegistriesFromCWD in cmd/dbc/driver_list.go, TestInstallCmdDBCBaseURLOverridesGlobalConfig ↩ ↩2

    2. Cargo (rust-lang/cargo 6689a7e): tests/testsuite/bad_config.rs L2326–2349, doc/book/src/CHANGELOG.md L7347–7358, src/context/mod.rs L1056–1065 ↩ ↩2

    3. uv (astral-sh/uv c2f08ef0): crates/uv-settings/src/lib.rs L58–84, docs/concepts/configuration-files.md L69 ↩

    4. mise (jdx/mise 8e9f47c9): docs/configuration/environment-variables.md L56–58 ↩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions