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.
-
Install Node.js (version 22 or later)
-
Install Sail:
uv tool install pysail
-
Start the Sail Flight SQL server:
sail flight server --ip 127.0.0.1 --port 32010
-
Install the Flight SQL ADBC driver:
dbc install flightsql
-
Install dependencies:
npm --prefix ../.. install
-
Customize the script
main.jsas needed- Change the connection arguments in
databaseOptionsuriis 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 begrpcfor plain connections orgrpc+tlsif your server is configured with TLS.
- Change the SQL SELECT statement in
conn.query()if desired
- Change the connection arguments in
-
Run the script:
Node.js:
node main.js
Bun:
bun run main.js
Deno:
deno run --allow-ffi --allow-env main.js
Stop the Sail Flight SQL server by pressing Ctrl-C in the terminal where it is running.