Skip to content

Profile option values are not expanded with env_var substitution #19

Closed

Description

@theiotidiot

Summary

When connecting via a profile (databow --profile NAME), option values containing the ADBC {{ env_var(NAME) }} substitution template are passed to the driver verbatim instead of being expanded from the process environment. As a result, profiles that rely on environment-variable substitution to inject credentials or URIs (per the ADBC connection-profile spec) fail to connect.

Reproduction

/tmp/repro.toml:

profile_version = 1
driver = "databricks"

[Options]
uri = "databricks://token:{{ env_var(DATABRICKS_TOKEN) }}@host.cloud.databricks.com:443/sql/1.0/warehouses/abc123"
$ DATABRICKS_TOKEN=dapi... databow --profile /tmp/repro.toml --query "SELECT 1"
Failed to create connection: Unknown: [Databricks] databricks: request error: invalid DSN: invalid format: parse "https://token:{{ env_var(DATABRICKS_TOKEN) }}@host.cloud.databricks.com:443/...": net/url: invalid userinfo (sqlstate: [0, 0, 0, 0, 0], vendor_code: -2147483648)

The literal {{ env_var(DATABRICKS_TOKEN) }} template reaches the driver instead of the token value.

Root Cause

adbc_driver_manager only applies env-var substitution along the DriverLocator::Profile code path in ManagedDriver::new_database_with_opts (see lib.rs:593-604 in adbc_driver_manager 0.23.0, which calls process_profile_value for every OptionValue::String).

databow::database::initialize_profile_connection bypasses that path: it loads the profile via FilesystemProfileProvider, collects options with profile.get_options(), and passes them straight to driver.new_database_with_opts(...) without ever calling process_profile_value. Substitution never runs.

Expected Behavior

Profile option values containing {{ env_var(NAME) }} should be expanded against the process environment before the options are handed to the driver — matching the ADBC spec and the behavior users get when going through the driver manager's own DriverLocator::Profile path.

Environment

  • databow 0.1.0
  • macOS arm64
  • adbc_driver_manager 0.23.0

Happy to send a PR.

Activity

  1. theiotidiot commented on Jul 7, 2026

    @theiotidiot
    ContributorAuthor

    @esadek Curious about your thoughts on this. I'm wanting to make databow available to my team's repo as a default dev tool and having the templated profiles is the lowest friction and most secure way to get people onboard.

  2. esadek commented on Jul 7, 2026

    @esadek
    Collaborator

    @theiotidiot Will look into this today.

  3. added a commit that references this issue on Jul 8, 2026
    974d474
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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions