X Tutup
Skip to content

superdupershant/databricks-sql-node

 
 

Repository files navigation

Hive Driver

Description

Databricks SQL Driver is a JavaScript driver for connection to Databricks SQL via Thrift API.

Installation

npm i databricks-sql-node

Usage

examples/usage.js

const { DBSQLClient } = require('databricks-sql-node');

const client = new DBSQLClient();
const utils = DBSQLClient.utils;

client.connect({
    host: '********.databricks.com',
    path: '/sql/1.0/endpoints/****************',
    token: 'dapi********************************',
}).then(async client => {
    const session = await client.openSession();

    const queryOperation = await session.executeStatement('SELECT "Hello, World!"', { runAsync: true });
    await utils.waitUntilReady(queryOperation, false, () => {});
    await utils.fetchAll(queryOperation);
    await queryOperation.close();

    const result = utils.getResult(queryOperation).getValue();
    console.table(result);

    await session.close();
    await client.close();
}).catch(error => {
    console.log(error);
});

For more details see: Getting Started

Test

Unit tests:

npm run test

e2e tests:

npm run e2e

Before running e2e tests, create local configuration file

Contributing

See CONTRIBUTING.md

Issues

If you find some issues, feel free to create an issue or send a pull request.

License

Apache License 2.0

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 44.2%
  • TypeScript 39.4%
  • Thrift 16.4%
X Tutup