Skip to content

Latest commit

 

History

History
95 lines (63 loc) · 2.38 KB

File metadata and controls

95 lines (63 loc) · 2.38 KB

Connecting JavaScript and Yellowbrick with ADBC

Instructions

Tip

If you already have a Yellowbrick instance running, skip the steps to set up and clean up Yellowbrick.

Prerequisites

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

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

Set up Yellowbrick

  1. Install Docker

Warning

On Apple Silicon Macs, Yellowbrick Community Edition works with OrbStack but not with Docker Desktop.

  1. Start a Yellowbrick Community Edition instance:

    docker run -d --rm --privileged --name yellowbrick -p 443:443 -p 5432:5432 yellowbrickdata/yb-community-edition:latest
  2. Wait for the service to be ready (it should print localhost:5432 - accepting connections):

    docker exec yellowbrick pg_isready -h localhost -p 5432

Connect to Yellowbrick

  1. Install the PostgreSQL ADBC driver:

    dbc install postgresql
  2. Install dependencies:

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

  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 the Docker container running Yellowbrick:

docker stop yellowbrick