Tip
If you already have a SingleStore instance running, skip the steps to set up and clean up SingleStore.
-
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 C++ program
main.cpp- Change the connection arguments in the
AdbcDatabaseSetOption()calls- Format the URI according to the DSN (Data Source Name) format used by Go-MySQL-Driver
- If you changed which database you're connecting to, also change the SQL SELECT statement in
AdbcStatementSetSqlQuery()
- Change the connection arguments in the
-
Build and run the C++ program:
Using Make:
pixi run make ./singlestore_demo
Or using CMake:
pixi run cmake -B build pixi run cmake --build build ./build/singlestore_demo
-
Stop the Docker container running SingleStore:
docker stop singlestoredb-dev
-
Clean build artifacts:
Using Make:
pixi run make clean
Using CMake:
rm -rf build