# @databricks/sql

> Driver for connection to Databricks SQL via Thrift API.

Latest version **2.1.0** (published 2026-09-01) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @databricks/sql
pnpm add @databricks/sql
yarn add @databricks/sql
bun add @databricks/sql
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2026-09-01 |
| First published | 2022-06-24 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=20.0.0 |
| Dependencies | 11 |
| Unpacked size | 1.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 36 |
| Keywords | databricks sql, hiveserver2, apache, hive, hs2, client, thrift, nodejs, js, hive, hive js |

## Links

- npm: https://www.npmjs.com/package/@databricks/sql
- Repository: https://github.com/databricks/databricks-sql-nodejs
- Homepage: https://github.com/databricks/databricks-sql-nodejs#readme
- Issues: https://github.com/databricks/databricks-sql-nodejs/issues
- npm.io page: https://npm.io/package/@databricks/sql

## Dependencies (11)

- [open](https://npm.io/package/open.md) ^8.4.2
- [uuid](https://npm.io/package/uuid.md) ^11.1.1
- [thrift](https://npm.io/package/thrift.md) ^0.23.0
- [winston](https://npm.io/package/winston.md) ^3.8.2
- [commander](https://npm.io/package/commander.md) ^9.3.0
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.12
- [node-int64](https://npm.io/package/node-int64.md) ^0.4.0
- [flatbuffers](https://npm.io/package/flatbuffers.md) 23.5.26
- [proxy-agent](https://npm.io/package/proxy-agent.md) ^6.3.1
- [apache-arrow](https://npm.io/package/apache-arrow.md) ^13.0.0
- [openid-client](https://npm.io/package/openid-client.md) ^5.4.2

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 2.1.0 (latest) — 2026-09-01
- 1.16.0-rc.1 (next) — 2026-06-11
- 2.0.0 — 2026-07-14
- 1.17.0 — 2026-07-13
- 1.16.0 — 2026-06-15
- 1.15.0 — 2026-05-26
- 1.14.0 — 2026-05-08
- 1.13.0 — 2026-03-02
- 1.12.0 — 2025-09-18
- 1.11.0 — 2025-05-19
- 1.10.0 — 2025-03-12
- 1.9.0 — 2024-12-16
- 1.8.4 — 2024-04-19
- 1.8.3 — 2024-03-27
- 1.8.2 — 2024-03-12
- … 16 more at https://npm.io/package/@databricks/sql/versions

## README

# Databricks SQL Driver for Node.js

![http://www.apache.org/licenses/LICENSE-2.0.txt](http://img.shields.io/:license-Apache%202-brightgreen.svg)
[![npm](https://img.shields.io/npm/v/@databricks/sql?color=blue&style=flat)](https://www.npmjs.com/package/@databricks/sql)
[![test](https://github.com/databricks/databricks-sql-nodejs/workflows/test/badge.svg?branch=main)](https://github.com/databricks/databricks-sql-nodejs/actions?query=workflow%3Atest+branch%3Amain)
[![coverage](https://codecov.io/gh/databricks/databricks-sql-nodejs/branch/main/graph/badge.svg)](https://codecov.io/gh/databricks/databricks-sql-nodejs)

## 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](https://github.com/lenchv/hive-driver) which connects via Thrift API.

## Requirements

- Node.js 20 or newer

## Installation

```bash
npm i @databricks/sql
```

## Usage

[examples/usage.js](examples/usage.js)

```javascript
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);
  });
```

## Configuration

See [CONNECTION_PARAMETERS.md](CONNECTION_PARAMETERS.md) for every connection,
session, and per-statement parameter the driver accepts, and whether each one
applies to the Thrift backend (default), the SEA backend, or both.

## 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:

```bash
npm test
npm test -- <path/to/file.test.js>
```

### 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:

```javascript
{
    host: '***.databricks.com',
    path: '/sql/2.0/warehouses/***',
    token: 'dapi***',
    database: ['catalog', 'database'],
}
```

Then run

```bash
npm run e2e
npm run e2e -- <path/to/file.test.js>
```

## 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)

---
_Source: https://npm.io/package/@databricks/sql · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
