Tip
If you already have a SingleStore instance running, skip the steps to set up and clean up SingleStore.
-
Ensure the native Arrow GLib and ADBC GLib libraries required by
red-adbcare installed and discoverable. Ifbundle installreports missingarrow,arrow-glib, oradbc-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. -
Install Ruby dependencies:
bundle install
If you have multiple Ruby installations, ensure
rubyandbundleresolve to the same installation before running this command.
-
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.
-
Install the SingleStore ADBC driver:
dbc install --level user --pre singlestore
-
Customize the Ruby script
main.rbas needed- Change the connection arguments in
database.set_option()- Format
uriaccording to the DSN (Data Source Name) format used by Go-MySQL-Driver
- Format
- If you changed which database you're connecting to, also change the SQL SELECT statement in
connection.query()
- Change the connection arguments in
-
Run the Ruby script:
bundle exec ruby main.rb
Stop the Docker container running SingleStore:
docker stop singlestoredb-dev