-
Notifications
You must be signed in to change notification settings - Fork 5
InfluxDB IOx
Brett Buddin edited this page Jan 12, 2023
·
3 revisions
InfluxDB IOx requires bucket-name or bucket-id to be presented as gRPC metadata in Flight SQL requests. When creating a FlightSQLClient directly this means providing these keys in the metadata dictionary. When dialing via SQLAlchemy's DSN you will add bucket-name/bucket-id as additional query parameters.
from flightsql import FlightSQLClient
client = FlightSQLClient(
host="",
token="INFLUXDBTOKEN",
metadata={"bucket-name": "_tasks"},
)Same as Directly with Client, but passing the client into connect.
from flightsql import FlightSQLClient, connect
client = FlightSQLClient(
host="",
token="INFLUXDBTOKEN",
metadata={"bucket-name": "_tasks"},
)
conn = connect(client)import flightsql.sqlalchemy
from sqlalchemy.engine import create_engine
engine = create_engine("datafusion+flightsql://...:443?token=INFLUXDBTOKEN&bucket-name=_tasks")