adbc_driver_flightsql#

Low-Level API#

Low-level ADBC bindings for the Flight SQL driver.

class adbc_driver_flightsql.ConnectionOptions(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#

Bases: Enum

Connection options specific to the Flight SQL driver.

RPC_CALL_HEADER_PREFIX = 'adbc.flight.sql.rpc.call_header.'#

Add an arbitrary header to all outgoing requests.

This option should prefix the name of the header to add (i.e. it should be used like f"{ConnectionOptions.RPC_CALL_HEADER_PREFIX}x-my-header").

Overrides any headers set via the equivalent database option.

TIMEOUT_FETCH = 'adbc.flight.sql.rpc.timeout_seconds.fetch'#

Set a timeout on calls that fetch data (in floating-point seconds).

This corresponds to Flight RPC DoGet calls.

TIMEOUT_QUERY = 'adbc.flight.sql.rpc.timeout_seconds.query'#

Set a timeout on calls that execute queries (in floating-point seconds).

This corresponds to Flight RPC GetFlightInfo calls.

TIMEOUT_UPDATE = 'adbc.flight.sql.rpc.timeout_seconds.update'#

Set a timeout on calls that upload or update data (in floating-point seconds).

class adbc_driver_flightsql.DatabaseOptions(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#

Bases: Enum

Database options specific to the Flight SQL driver.

AUTHORIZATION_HEADER = 'adbc.flight.sql.authorization_header'#

The authorization header to use for requests.

MTLS_CERT_CHAIN = 'adbc.flight.sql.client_option.mtls_cert_chain'#

Enable mTLS and use these PEM-encoded certificates.

MTLS_PRIVATE_KEY = 'adbc.flight.sql.client_option.mtls_private_key'#

Enable mTLS and use this PEM-encoded private key.

RPC_CALL_HEADER_PREFIX = 'adbc.flight.sql.rpc.call_header.'#

Add an arbitrary header to all outgoing requests.

This option should prefix the name of the header to add (i.e. it should be used like f"{DatabaseOptions.RpcCallHeaderPrefix}.x-my-header").

TIMEOUT_FETCH = 'adbc.flight.sql.rpc.timeout_seconds.fetch'#

Set a timeout on calls that fetch data (in floating-point seconds).

This corresponds to Flight RPC DoGet calls.

TIMEOUT_QUERY = 'adbc.flight.sql.rpc.timeout_seconds.query'#

Set a timeout on calls that execute queries (in floating-point seconds).

This corresponds to Flight RPC GetFlightInfo calls.

TIMEOUT_UPDATE = 'adbc.flight.sql.rpc.timeout_seconds.update'#

Set a timeout on calls that upload or update data (in floating-point seconds).

TLS_OVERRIDE_HOSTNAME = 'adbc.flight.sql.client_option.tls_override_hostname'#

Override the hostname used for TLS.

TLS_ROOT_CERTS = 'adbc.flight.sql.client_option.tls_root_certs'#

Use these PEM-encoded root certificates for TLS.

TLS_SKIP_VERIFY = 'adbc.flight.sql.client_option.tls_skip_verify'#

Do not verify the server’s TLS certificate.

WITH_BLOCK = 'adbc.flight.sql.client_option.with_block'#

Block and wait for the connection to be established.

WITH_MAX_MSG_SIZE = 'adbc.flight.sql.client_option.with_max_msg_size'#

Set the maximum gRPC message size (in bytes). The default is 16 MiB.

class adbc_driver_flightsql.StatementOptions(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#

Bases: Enum

Statement options specific to the Flight SQL driver.

QUEUE_SIZE = 'adbc.rpc.result_queue_size'#

The number of batches to queue per partition. Defaults to 5.

This controls how much we read ahead on result sets.

RPC_CALL_HEADER_PREFIX = 'adbc.flight.sql.rpc.call_header.'#

Add an arbitrary header to all outgoing requests.

This option should prefix the name of the header to add (i.e. it should be used like f"{ConnectionOptions.RPC_CALL_HEADER_PREFIX}x-my-header").

Overrides any headers set via the equivalent database or connection options.

SUBSTRAIT_VERSION = 'adbc.flight.sql.substrait.version'#

Set the Substrait version passed in the Flight SQL request.

Most servers will not make use of this since the Substrait specification was updated to embed the version in the plan itself after this was originally added to Flight SQL.

TIMEOUT_FETCH = 'adbc.flight.sql.rpc.timeout_seconds.fetch'#

Set a timeout on calls that fetch data (in floating-point seconds).

This corresponds to Flight RPC DoGet calls.

TIMEOUT_QUERY = 'adbc.flight.sql.rpc.timeout_seconds.query'#

Set a timeout on calls that execute queries (in floating-point seconds).

This corresponds to Flight RPC GetFlightInfo calls.

TIMEOUT_UPDATE = 'adbc.flight.sql.rpc.timeout_seconds.update'#

Set a timeout on calls that upload or update data (in floating-point seconds).

adbc_driver_flightsql.connect(uri: str, db_kwargs: Optional[Dict[str, str]] = None) AdbcDatabase#

Create a low level ADBC connection to a Flight SQL backend.

Parameters:
uristr

The URI to connect to.

db_kwargsdict, optional

Initial database connection parameters.

DBAPI 2.0 API#

DBAPI 2.0-compatible facade for the ADBC Arrow Flight SQL driver.

adbc_driver_flightsql.dbapi.connect(uri: str, db_kwargs: Optional[Dict[str, str]] = None, conn_kwargs: Optional[Dict[str, str]] = None, **kwargs) Connection#

Connect to a Flight SQL backend via ADBC.

Parameters:
uristr

The URI to connect to.

db_kwargsdict, optional

Initial database connection parameters.

conn_kwargsdict, optional

Connection-specific parameters. (ADBC differentiates between a ‘database’ object shared between multiple ‘connection’ objects.)