This example uses InfluxDB, a time series database that supports Arrow Flight SQL.
Tip
If you already have an InfluxDB instance running, skip the steps to set up and clean up InfluxDB.
-
Start an InfluxDB instance:
docker run -d --rm --name influxdb -p 8181:8181 influxdb:3-core influxdb3
-
Create an authorization token:
docker exec -it influxdb influxdb3 create token --admin
-
Install the Flight SQL ADBC driver:
dbc install flightsql
-
Customize the Python script
main.pyas needed.- Change the connection arguments in
db_kwargs.uriis the URI of your InfluxDB instance. The host and port will depend on your installation.adbc.flight.sql.authorization_headeris the authorization header used for requests. ReplaceYOUR_AUTH_TOKENwith your InfluxDB authorization token.adbc.flight.sql.rpc.call_header.databaseis the name of your InfluxDB database.
- If you changed which database you're connecting to, also change the SQL SELECT statement in
cursor.execute().
- Change the connection arguments in
-
Run the Python script:
uv run main.py
Stop the Docker container running InfluxDB:
docker stop influxdb