Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Connecting JavaScript and Sail with ADBC

Instructions

This example uses Sail, a fast query engine that supports Arrow Flight SQL.

Tip

If you already have a Sail Flight SQL server running, skip the steps to set up Sail.

Prerequisites

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

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

  3. Install dbc

Set up Sail

  1. Install Sail:

    uv tool install pysail
  2. Start the Sail Flight SQL server:

    sail flight server --ip 127.0.0.1 --port 32010

Connect to Sail

  1. Install the Flight SQL ADBC driver:

    dbc install flightsql
  2. Install dependencies:

    npm --prefix ../.. install
  3. Customize the script main.js as needed

    • Change the connection arguments in databaseOptions
      • uri is the URI of your Sail Flight SQL server. The host and port will depend on your installation (the default port is 32010). The protocol scheme should be grpc for plain connections or grpc+tls if your server is configured with TLS.
    • Change the SQL SELECT statement in conn.query() if desired
  4. Run the script:

    Node.js:

    node main.js

    Bun:

    bun run main.js

    Deno:

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

Clean up

Stop the Sail Flight SQL server by pressing Ctrl-C in the terminal where it is running.