Skip to content

feat(databricks): add Databricks SQL adapter - #241

Merged
Maxteabag merged 7 commits into
mainfrom
feat/databricks-adapter
Sep 5, 2026
Merged

feat(databricks): add Databricks SQL adapter#241
Maxteabag merged 7 commits into
mainfrom
feat/databricks-adapter

Conversation

@Maxteabag

@Maxteabag Maxteabag commented May 25, 2026

Copy link
Copy Markdown
Owner

Adds Databricks SQL support with Unity Catalog browsing, legacy Hive-metastore metadata, PAT authentication, browser OAuth, and service-principal OAuth.

Provider token fields use sqlit's existing protected credential slot. Saved connections can be reopened and renamed without putting tokens in connection JSON or driver-restart caches. Legacy plaintext token fields migrate into the credential backend, and changing authentication mode clears an incompatible old secret. Browser OAuth avoids database-password prompts. Connection URL parameters are normalized before validation, and the Databricks extra installs the OAuth SDK.

Verification at 93d3f78d53e3c8914725e20796204a2d223e8b9c:

  • 157 focused local tests passed; six cases for the other provider are skipped in this branch.
  • All 22 GitHub CI checks passed, including the new Databricks dependency/regression lane.
  • The opt-in cloud regression passed against Databricks Free Edition with PAT authentication: CLI creation via stdin, OS-keyring persistence, a query from a separate CLI process, metadata/row limits, and a query after rename. Temporary schemas and credentials are cleaned up.
  • OAuth configuration and Hive-metastore metadata paths have regression coverage using test doubles and the installed SDK. Live coverage uses PAT authentication and Unity Catalog.

See tests/integration/test_cloud_provider_credentials.py and CONTRIBUTING.md for the reproducible cloud test. No cloud secrets are required by ordinary CI.

Maxteabag added 2 commits May 25, 2026 17:00
Three-level Unity Catalog (catalog.schema.table) via databricks-sql-connector.
Supports PAT, OAuth U2M (browser), and OAuth M2M (service principal) auth.
@Maxteabag

Copy link
Copy Markdown
Owner Author

Anyone using databricks: feel free to test this PR.

The information_schema filter used `table_type IN ('MANAGED', 'EXTERNAL',
'BASE TABLE')`. 'BASE TABLE' is not a Unity Catalog table_type at all, and
the include-list hid FOREIGN (Lakehouse Federation), STREAMING_TABLE,
MANAGED_SHALLOW_CLONE and EXTERNAL_SHALLOW_CLONE from the explorer tree.

Invert it: tables are everything that is not VIEW or MATERIALIZED_VIEW, so
table types Databricks adds later show up without another code change.
get_views now reads the same information_schema.tables column instead of
information_schema.views, which keeps the two lists complementary and picks
up materialized views regardless of whether they appear in the views table.

Claude-Session: https://claude.ai/code/session_01S6TsbrUgqAv3UETAfkg1ip
@Maxteabag
Maxteabag merged commit 32918e8 into main Sep 5, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant