arrow-odbc Adapter¶
from sqlspec.adapters.arrow_odbc import (
ArrowOdbcConfig,
ArrowOdbcConnectionParams,
ArrowOdbcDriver,
ArrowOdbcDriverFeatures,
ArrowOdbcExceptionHandler,
)
Apache Arrow over ODBC adapter built on arrow-odbc for zero-copy Arrow batch streaming from any ODBC-compliant data source (SQL Server, PostgreSQL, Oracle, Snowflake, Db2). Inherited execution methods are documented on SyncDriverAdapterBase. See the Arrow ODBC Setup Guide for connection string and batch streaming examples.
Configuration & Parameters¶
ArrowOdbcConfig
¶
Bases: NoPoolSyncConfig[ArrowOdbcConnection, ArrowOdbcDriver]
Configuration for synchronous arrow-odbc connections.
ArrowOdbcConnectionParams
¶
Bases: TypedDict
ODBC connection parameters compiled into an arrow-odbc connection string.
Attributes:
| Name | Type | Description |
|---|---|---|
connection_string |
NotRequired[str]
|
Full ODBC |
dsn |
NotRequired[str]
|
Registered ODBC Data Source Name ( |
driver |
NotRequired[str]
|
Installed ODBC driver name or library path ( |
server |
NotRequired[str]
|
Target database server address or |
host |
NotRequired[str]
|
Hostname alias used when |
database |
NotRequired[str]
|
Target catalog or database name ( |
uid |
NotRequired[str]
|
ODBC authentication user identifier ( |
pwd |
NotRequired[str]
|
ODBC authentication password ( |
user |
NotRequired[str]
|
Alias normalized to |
password |
NotRequired[str]
|
Alias normalized to |
trusted_connection |
NotRequired[bool | str]
|
Use integrated OS or Kerberos authentication ( |
trust_server_certificate |
NotRequired[bool | str]
|
Trust self-signed server TLS certificates without CA chain validation. |
encrypt |
NotRequired[bool | str]
|
Require or configure TLS encryption on the ODBC connection. |
login_timeout |
NotRequired[int]
|
Connection login timeout in seconds forwarded to |
login_timeout_sec |
NotRequired[int]
|
Alias for |
packet_size |
NotRequired[int]
|
Network packet size in bytes negotiated by the ODBC driver. |
autocommit |
NotRequired[bool]
|
Initial connection autocommit state (defaults to |
extra |
NotRequired[dict[str, Any]]
|
Additional ODBC connection-string attributes merged verbatim. |
ArrowOdbcDriverFeatures
¶
Bases: TypedDict
arrow-odbc driver feature flags controlling Arrow batch sizing, dialect hints, and codecs.
Attributes:
| Name | Type | Description |
|---|---|---|
chunk_size |
NotRequired[int]
|
Maximum rows per Arrow |
max_bytes_per_batch |
NotRequired[int]
|
Upper memory budget in bytes per Arrow |
max_text_size |
NotRequired[int]
|
Maximum byte length allocated for unbounded |
max_binary_size |
NotRequired[int]
|
Maximum byte length allocated for unbounded |
fetch_concurrently |
NotRequired[bool]
|
Prefetch the next ODBC batch on a background Rust thread while Arrow batches are consumed. |
query_timeout_sec |
NotRequired[int]
|
Per-statement ODBC query execution timeout in seconds. |
payload_text_encoding |
NotRequired[TextEncoding]
|
Wire text encoding override ( |
enable_driver_pooling |
NotRequired[bool]
|
Enable process-global ODBC driver-manager connection pooling prior to first connect (defaults to |
connection_string |
NotRequired[str]
|
Resolved connection string inspected for SQL dialect auto-detection. |
dbms_name |
NotRequired[str]
|
Database engine hint (such as |
connection_autocommit |
NotRequired[bool]
|
Effective autocommit baseline derived from |
enable_lowercase_column_names |
NotRequired[bool]
|
Normalize unquoted uppercase column names to lowercase (defaults to |
json_serializer |
NotRequired[Callable[[Any], str]]
|
Serializer converting dict/list parameters to JSON text (defaults to |
json_deserializer |
NotRequired[Callable[[str], Any]]
|
Deserializer parsing JSON text payloads (defaults to |
enable_events |
NotRequired[bool]
|
Enable SQLSpec table-backed event channel support. |
on_connection_create |
NotRequired[Callable[[ArrowOdbcConnection], None]]
|
Callback invoked with the raw |
Driver & Pool¶
ArrowOdbcDriver
¶
ArrowOdbcExceptionHandler
¶
Extension Stores¶
ArrowOdbcStore
¶
Bases: BaseSQLSpecStore['ArrowOdbcConfig']
Session store using arrow-odbc sessions.
SQL Server statements are used by default; a config whose dialect resolves
to db2 uses Db2 statements with bound UTC times and catalog-probed DDL.
ArrowOdbcADKStore
¶
Bases: BaseSyncADKStore['ArrowOdbcConfig']
Synchronous ADK session/event store using arrow-odbc.
SQL Server statements are used by default; a config whose dialect resolves
to db2 uses Db2 statements with bound UTC times and catalog-probed DDL.
ArrowOdbcADKMemoryStore
¶
Bases: BaseSyncADKMemoryStore['ArrowOdbcConfig']
ADK memory store using arrow-odbc.
SQL Server statements are used by default; a config whose dialect resolves
to db2 uses Db2 statements with bound UTC times and catalog-probed DDL.
ArrowOdbcEventQueueStore
¶
Bases: BaseEventQueueStore[ArrowOdbcConfig]
Event queue DDL for arrow-odbc configs.
SQL Server DDL with OBJECT_ID guards is used by default. A config whose
dialect resolves to db2 gets plain Db2 CREATE TABLE/CREATE INDEX
statements; the events migration checks the catalog for the table and the
index before running them.