This example uses Apache Doris, a high-performance, real-time analytical database.
Tip
If you already have an Apache Doris instance running, skip the steps to set up Apache Doris.
-
Install Node.js (version 22 or later)
Warning
This setup process has not been tested on Windows and might not work without modification. Windows users should run it under WSL.
-
Download the Apache Doris quick-start script:
curl -O https://doris.apache.org/files/start-doris.sh
-
Add Flight SQL ports and configure the backend to advertise
localhost:sed -i.bak -f patch-doris.sed start-doris.sh
-
Start an Apache Doris cluster:
chmod 755 start-doris.sh ./start-doris.sh
-
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 Apache Doris instance. The host and FE Arrow Flight SQL port will depend on your installation.usernameandpasswordare the username and password of your Apache Doris user.
- 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 Docker project running Apache Doris:
docker compose -f docker-compose-doris.yaml down