databricks/databricks-sql-nodejs
TypeScript
Captured source
source ↗databricks/databricks-sql-nodejs
Description: Databricks SQL Connector for Node.js
Language: TypeScript
License: Apache-2.0
Stars: 34
Forks: 49
Open issues: 61
Created: 2022-05-19T18:07:23Z
Pushed: 2026-06-10T23:59:52Z
Default branch: main
Fork: no
Archived: no
README:
Databricks SQL Driver for Node.js
 
Description
The Databricks SQL Driver for Node.js is a Javascript driver for applications that connect to Databricks clusters and SQL warehouses. This project is a fork of Hive Driver which connects via Thrift API.
Requirements
- Node.js 14 or newer
Installation
npm i @databricks/sql
Usage
[examples/usage.js](examples/usage.js)
const { DBSQLClient } = require('@databricks/sql');
const client = new DBSQLClient();
client
.connect({
host: '********.databricks.com',
path: '/sql/2.0/warehouses/****************',
token: 'dapi********************************',
})
.then(async (client) => {
const session = await client.openSession();
const queryOperation = await session.executeStatement('SELECT "Hello, World!"');
const result = await queryOperation.fetchAll();
await queryOperation.close();
console.table(result);
await session.close();
await client.close();
})
.catch((error) => {
console.log(error);
});Telemetry
The driver emits connection, statement, and CloudFetch metrics plus redacted error events to help Databricks improve driver reliability. No SQL text, parameter values, or row data is ever collected. Emission is gated by a server-side feature flag and can be disabled per-connection with telemetryEnabled: false or globally with the DATABRICKS_TELEMETRY_DISABLED env var.
See [docs/TELEMETRY.md](docs/TELEMETRY.md) for the full event payloads, tuning knobs, multi-tenant guidance, and troubleshooting.
Run Tests
Unit tests
You can run all unit tests, or specify a specific test to run:
npm test npm test --
e2e tests
Before running end-to-end tests, create a file named tests/e2e/utils/config.local.js and set the Databricks SQL connection info:
{
host: '***.databricks.com',
path: '/sql/2.0/warehouses/***',
token: 'dapi***',
database: ['catalog', 'database'],
}Then run
npm run e2e npm run e2e --
Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md)
Issues
If you find any issues, feel free to create an issue or send a pull request directly.
License
[Apache License 2.0](LICENSE)