Skip to content

Latest commit

 

History

History

trino

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Connecting JavaScript and Trino with ADBC

Instructions

Tip

If you already have a Trino instance running, skip the steps to run Trino in a Docker container.

Prerequisites

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

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

  3. Install Docker

Set up Trino

  1. Start Trino in a Docker container:

    docker run -d --name trino -p 8080:8080 trinodb/trino

Connect to Trino

  1. Install the Trino ADBC driver:

    dbc install trino
  2. Install dependencies:

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

    • Change the connection arguments in databaseOptions
    • If you changed which Trino instance you're connecting to, also change the SQL SELECT statement in conn.query()
  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 and remove the Docker container running Trino:

docker stop trino
docker rm trino