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.
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:The literal
{{ env_var(DATABRICKS_TOKEN) }}template reaches the driver instead of the token value.Root Cause
adbc_driver_manageronly applies env-var substitution along theDriverLocator::Profilecode path inManagedDriver::new_database_with_opts(seelib.rs:593-604inadbc_driver_manager0.23.0, which callsprocess_profile_valuefor everyOptionValue::String).databow::database::initialize_profile_connectionbypasses that path: it loads the profile viaFilesystemProfileProvider, collects options withprofile.get_options(), and passes them straight todriver.new_database_with_opts(...)without ever callingprocess_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 ownDriverLocator::Profilepath.Environment
databow0.1.0adbc_driver_manager0.23.0Happy to send a PR.