Skip to content

Latest commit

 

History

History
93 lines (63 loc) · 2.28 KB

File metadata and controls

93 lines (63 loc) · 2.28 KB

Connecting JavaScript and SingleStore with ADBC

Instructions

Tip

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

Prerequisites

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

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

Set up SingleStore

  1. Install Docker

  2. Start a SingleStore instance:

    docker run \
        -d --rm --name singlestoredb-dev \
        -e ROOT_PASSWORD="YOUR_ROOT_PASSWORD" \
        -p 3306:3306 -p 8080:8080 -p 9000:9000 \
        ghcr.io/singlestore-labs/singlestoredb-dev:latest

Important

To run the container on Apple Silicon, add the --platform linux/amd64 option.

Connect to SingleStore

  1. Install the SingleStore ADBC driver:

    dbc install --pre singlestore
  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 SingleStore:

docker stop singlestoredb-dev