Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Connecting C++ 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 Pixi

  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 --level user postgresql
  2. Customize the C++ program main.cpp as needed

    • Change the connection arguments in the AdbcDatabaseSetOption() calls
    • Change the SQL SELECT statement in AdbcStatementSetSqlQuery() if desired
  3. Build and run the C++ program:

    Using Make:

    pixi run make
    ./yellowbrick_demo

    Or using CMake:

    pixi run cmake -B build
    pixi run cmake --build build
    ./build/yellowbrick_demo

Clean up

  1. Clean build artifacts:

    Using Make:

    pixi run make clean

    Using CMake:

    rm -rf build
  2. Stop the Docker container running Yellowbrick:

    docker stop yellowbrick