Adapters
Databricks
Databricks adapter configuration for SQLBuild.
Databricks requires the optional databricks-sql-connector dependency:
pip install 'sqlbuild[databricks]'# oruv pip install 'sqlbuild[databricks]'Connection config
Section titled “Connection config”adapter = "databricks"default_target = "dev"
[connections.workspace]server_hostname = "my-workspace.cloud.databricks.com"http_path = "/sql/1.0/warehouses/abc123"token = "dapi_my_access_token"
[targets.dev]connection = "workspace"database = "my_catalog"schema = "my_schema"| Field | Description |
|---|---|
server_hostname |
Databricks workspace hostname (required) |
http_path |
SQL warehouse or cluster HTTP path (required) |
token |
Personal access token (required) |
The target’s database selects the Unity Catalog catalog, and its schema selects the schema.
Session initialization
Section titled “Session initialization”On connect, SQLBuild runs USE CATALOG and USE SCHEMA statements from the active target to set
the authoritative session namespace.
Functions in unit tests
Section titled “Functions in unit tests”sqb test creates each SQL UDF and table function the selected tests call as a session
TEMPORARY FUNCTION __sqb_test__<name>. Python UDFs cannot be temporary, so tests call the built
Python function. See Functions in sqb test.