Driver for connection to Databricks SQL via Thrift API.
npm install databricks-sql-nodejs- Removal of dependency on lz4 and @types/lz4
- Minor changes in testing stubs to support node 20
!http://www.apache.org/licenses/LICENSE-2.0.txt

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.
- Node.js 14 or newer
``bash`
npm i databricks-sql-nodejs
`javascript
const { DBSQLClient } = require('databricks-sql-nodejs');
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);
});
`
You can run all unit tests, or specify a specific test to run:
`bash`
npm test
npm test --
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 --
See CONTRIBUTING.md
If you find any issues, feel free to create an issue or send a pull request directly.