Tip
If you already have a Trino instance running, skip the steps to run Trino in a Docker container.
-
Install Node.js (version 22 or later)
-
Start Trino in a Docker container:
docker run -d --name trino -p 8080:8080 trinodb/trino
-
Install the Trino ADBC driver:
dbc install trino
-
Install dependencies:
npm --prefix .. install
-
Customize the script
main.jsas needed- Change the connection arguments in
databaseOptions- Format
uriaccording to the DSN (Data Source Name) format used by the Trino Go client, or keep it as is to use the TPC-H data included in the Trino Docker container image
- Format
- If you changed which Trino instance you're connecting to, also change the SQL SELECT statement in
conn.query()
- 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 and remove the Docker container running Trino:
docker stop trino
docker rm trino