adbcBridge is a small Apache-2.0 ADBC driver written in C11 that loads
an ODBC driver and exposes it through the Arrow ADBC C ABI: block-cursor
reads straight into Arrow record batches, bulk ingest, metadata,
partitioned parallel reads. I ran Firebird through it as one of 46
databases in a single compatibility workload and wanted to share the
entry here, since the quirks it records are Firebird-specific.
What was verified (Firebird 5; driver: Firebird ODBC 3.5.0-rc1):
Linux: PASS
macOS arm64: driver unavailable: firebird-odbc-driver v3-0-1 ships
Linux and Windows assets only
Windows x64: PASS (Firebird ODBC 3.0.1.18; the driver answers
SQL_DRIVER_NAME "FirebirdODBC" there and "OdbcFb" on Linux)
What the compatibility entry records:
SQL_C_WCHAR sized in 4-byte wchar_t; no usable parameter arrays.
Firebird's dialect has neither multi-row VALUES (-104 Token unknown at
the second row-group's comma) nor Oracle's INSERT ALL, so bulk ingest
batches through the third form it does take: INSERT INTO t (cols) SELECT
CAST(? AS <type>), ... FROM RDB$DATABASE UNION ALL SELECT ...
Full entry:
https://github.com/singhpratech/adbcbridge/blob/main/
docs/COMPATIBILITY.md
As far as I know there is no ADBC driver for Firebird of any kind, so
this is currently the way to get Firebird result sets into Arrow through
the ADBC API — from Python, Rust, Go, Java or C#, one shared library.
While running it I hit three bugs in the ODBC driver itself and wrote
them up with pure-ODBC C reproductions (no adbcBridge involved) on the
driver tracker: parameter arrays step fixed-length C types by
BufferLength so every row receives row 1's values (
https://github.com/
FirebirdSQL/firebird-odbc-driver/issues/299), a SQL_BIGINT parameter
bound once as SQL_C_DEFAULT keeps writing NULL after later SQL_C_SBIGINT
rebinds (
https://github.com/FirebirdSQL/firebird-odbc-driver/
issues/300), and SQLPrepare discards SQL_ATTR_ROWS_FETCHED_PTR set
before it (
https://github.com/FirebirdSQL/firebird-odbc-driver/
issues/301). The first two are silent — SQL_SUCCESS all the way and
wrong rows in the table — so if you drive Firebird through ODBC from
anything that uses parameter arrays, they are worth a look. adbcBridge
works around all three.
Trying it (Python; Rust, Go, Java and C# are on the docs site):
pip install adbcbridge
import adbcbridge
with adbcbridge.connect(uri="Driver=
/opt/firebird-odbc/
libOdbcFb.so;DBNAME=inet://localhost:3050//data/
mydb.fdb;UID=SYSDBA;PWD=...;CHARSET=UTF8;") as conn:
with conn.cursor() as cur:
cur.execute("SELECT * FROM RDB$RELATIONS")
table = cur.fetch_arrow_table() # a pyarrow.Table
Links:
Repository:
https://github.com/singhpratech/adbcbridge
Docs:
https://adbcbridge.org/docs/
Compatibility:
https://github.com/singhpratech/adbcbridge/blob/main/
docs/COMPATIBILITY.md
Upstream notes:
https://github.com/singhpratech/adbcbridge/blob/main/
docs/UPSTREAM.md
PyPI:
https://pypi.org/project/adbcbridge/
It is a 0.1.0. If the entry says something wrong about Firebird, or you
run a version or driver I didn't, an issue on the repository with the
details is the most useful thing you could send.