This example uses Sail, a fast query engine that supports Arrow Flight SQL.
Tip
If you already have a Sail Flight SQL server running, skip the steps to set up Sail.
-
Install Sail:
uv tool install pysail
-
Start the Sail Flight SQL server:
sail flight server --ip 127.0.0.1 --port 32010
-
Install the Flight SQL ADBC driver:
dbc install --level user flightsql
-
Customize the C++ program
main.cppas needed- Change the connection arguments in the
AdbcDatabaseSetOption()callsuriis the URI of your Sail Flight SQL server. The host and port will depend on your installation (the default port is 32010). The protocol scheme should begrpcfor plain connections orgrpc+tlsif your server is configured with TLS.
- Change the SQL SELECT statement in
AdbcStatementSetSqlQuery()if desired
- Change the connection arguments in the
-
Build and run the C++ program:
Using Make:
pixi run make ./sail_demo
Or using CMake:
pixi run cmake -B build pixi run cmake --build build ./build/sail_demo
-
Clean build artifacts:
Using Make:
pixi run make clean
Using CMake:
rm -rf build
-
Stop the Sail Flight SQL server by pressing
Ctrl-Cin the terminal where it is running.