Databricks SQL sandbox
Use a Databricks SQL Warehouse as a governed query execution sandbox for Fabric Harness sessions.
Package: @fabric-harness/databricks/sql-sandbox
Execution: Databricks SQL Statement Execution API
databricksSqlSandbox() maps session.shell(statement) to a SQL Warehouse. It is designed for data
agents whose shell abstraction should mean SQL, while retaining the common Fabric Harness sandbox
interface.
import { databricksSqlSandbox } from '@fabric-harness/databricks/sql-sandbox';
import { init } from '@fabric-harness/sdk';
const runtime = await init({
sandbox: databricksSqlSandbox({
host: process.env.DATABRICKS_HOST!,
token: async () => workspaceIdentity(),
warehouseId: process.env.DATABRICKS_WAREHOUSE_ID!,
catalog: 'main',
schema: 'analytics',
resultFormat: 'jsonl',
waitTimeoutSeconds: 30,
}),
});
const session = await runtime.session();
const result = await session.shell('SELECT current_user(), current_catalog()');Capabilities
| Capability | Behavior |
|---|---|
exec() | Executes one SQL statement and serializes result rows as JSONL or CSV |
| Text and binary files | Small in-memory map scoped to the sandbox instance |
| Snapshots and restore | Not supported |
| Network | Managed by the provider |
| Persistence | Session only for the in-memory file map |
| Isolation | Databricks SQL Warehouse plus its configured Unity Catalog access |
The file methods do not access DBFS, workspace files, or Unity Catalog Volumes. Mount a
databricksVolumeSource() for governed non-tabular data. Use Docker or another code sandbox for
bash, Python package installation, repository work, or arbitrary code execution.
Required access
The acting principal needs workspace access, permission to use the SQL Warehouse, and the required Unity Catalog grants. Prefer a rotating OAuth token provider rather than a long-lived token.
See Databricks connectors and sandboxes for the selection guide and full examples.