Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Connecting Ruby and Exasol with ADBC

Instructions

Tip

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

Prerequisites

  1. Install Ruby

  2. Install dbc

  3. Ensure the native Arrow GLib and ADBC GLib libraries required by red-adbc are installed and discoverable. If bundle install reports missing arrow, arrow-glib, or adbc-glib, use the platform-specific commands below.

    macOS with Homebrew
    brew install apache-arrow-glib apache-arrow-adbc-glib
    Debian/Ubuntu
    sudo apt install libarrow-glib-dev libadbc-glib-dev
    RHEL-compatible distributions
    sudo dnf install arrow-glib-devel adbc-glib-devel
    Windows with RubyInstaller/MSYS2 UCRT64
    pacman -S --needed mingw-w64-ucrt-x86_64-arrow mingw-w64-ucrt-x86_64-arrow-adbc-glib

    If you use a different MSYS2 environment, adjust the package prefix to match it; for example, use mingw-w64-x86_64-* from the MINGW64 shell.

  4. Install Ruby dependencies:

    bundle install

    If you have multiple Ruby installations, ensure ruby and bundle resolve to the same installation before running this command.

Set up Exasol

  1. Install Docker

Warning

The Exasol Docker image may not work with Docker for Windows or Docker for macOS. On macOS, we have found that Colima's x86_64 emulation may work better. Alternatively, consider Exasol Personal running in the cloud.

  1. Start Exasol in a Docker container (documentation):

    docker run \
       -p 127.0.0.1:9563:8563 \
       --name exasol \
       --privileged \
       --detach \
       exasol/docker-db:latest-2025.1
  2. Create a table in Exasol and load data into it:

    docker cp games.sql exasol:/tmp/games.sql
    docker cp load-data.sh exasol:/tmp/load-data.sh
    docker exec exasol bash /tmp/load-data.sh

Connect to Exasol

  1. Install the Exasol ADBC driver:

    dbc install --level user exasol
  2. Customize the Ruby script main.rb as needed

    • Change the connection arguments in database.set_option()
      • Change uri as needed, using query parameters to add more connection arguments, or keep it as is to use the data included with this example
    • If you changed which schema you're opening, also change the SQL SELECT statement in connection.query()
  3. Run the Ruby script:

    bundle exec ruby main.rb

Clean up

  1. Stop the Docker container running Exasol:

    docker stop exasol
    docker rm exasol