Tip
If you already have a DuckDB Quack server instance running, skip the steps to set up DuckDB.
-
Install Node.js (version 22 or later)
-
Start the DuckDB CLI:
duckdb
-
Create a table:
CREATE TABLE penguins AS FROM read_csv('https://blobs.duckdb.org/data/penguins.csv', nullstr = 'NA');
-
Start a server from the DuckDB session:
CALL quack_serve('quack:localhost');Note the
auth_tokenvalue that DuckDB prints.
-
Install the Quack ADBC driver:
dbc install --pre quack
-
Install dependencies:
npm --prefix .. install
-
Customize the script
main.jsas needed- Change the
uriconnection argument- Replace
YOUR_AUTH_TOKENwith theauth_tokenprinted by DuckDB - Change the host and port if applicable
- Replace
- If you changed which database you're connecting to, also change the SQL SELECT statement in
conn.query()
- Change the
-
Run the script:
Node.js:
node main.js
Bun:
bun run main.js
Deno:
deno run --allow-ffi --allow-env main.js
If you started a DuckDB server, exit the DuckDB CLI:
.exit