Tip
If you already have a Trino instance running, skip the steps to run Trino in a Docker container.
-
Start Trino in a Docker container:
docker run -d --rm --name trino -p 8080:8080 trinodb/trino
-
Install the Trino ADBC driver:
dbc install --level user trino
-
Customize the C++ program
main.cppas needed,- Change the connection arguments in the
AdbcDatabaseSetOption()calls- Format the URI according to the DSN (Data Source Name) format used by the Trino Go client, or keep it as is to use the TPC-H data included in the Trino Docker container image
- If you changed which Trino instance 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 ./trino_demo
Or using CMake:
pixi run cmake -B build pixi run cmake --build build ./build/trino_demo
-
Clean build artifacts:
Using Make:
pixi run make clean
Using CMake:
rm -rf build
-
Stop and remove the Docker container running Trino:
docker stop trino docker rm trino