Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Connecting JavaScript and Databricks with ADBC

Instructions

Prerequisites

  1. Install Node.js (version 22 or later)

    • Alternatively, you can use Bun or Deno
  2. Install dbc

  3. Create a Databricks account or be able to log in to an existing one

Set up Databricks

  1. Log into Databricks and create or locate an existing SQL warehouse

  2. Open the "Connection details" tab and record the server hostname and HTTP path. See the Databricks documentation describing how to get these connection details

Connect to Databricks

  1. Install the Databricks ADBC driver:

    dbc install databricks
  2. Install dependencies:

    npm --prefix .. install
  3. Customize the script main.js:

    • Change the connection arguments in databaseOptions:
    • Change the SQL SELECT statement in conn.query(), or keep it as is
      • Specify the catalog and schema by fully qualifying the table name as catalog.schema.table
  4. Run the script:

    Node.js:

    node main.js

    Bun:

    bun run main.js

    Deno:

    deno run --allow-ffi --allow-env main.js