Registry / database / adbc-driver-sqlite

adbc-driver-sqlite

JSON →
library1.12.0pypypi✓ verified 23d ago

adbc-driver-sqlite provides Python bindings for the Arrow Database Connectivity (ADBC) SQLite driver, offering a DBAPI 2.0 / PEP 249-compatible interface. It allows for Arrow-native access to SQLite databases. The current version is 1.11.0, and the project generally follows a bimonthly release cadence for minor versions.

pip install adbc-driver-sqlite
INSTALL
IMPORT
SIG · ADBC-DRIVER-SQLITE
A
adbc-driver-sqlite
databasepythonv1.12.0
Install
2.9s avg
Import
183ms
Disk
36MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.12.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
build_error
glibc
py 3.103.910 runs
installs and imports cleanly · install 2.9s · import 0.183s · 40MB
36MB installed
● package 36MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

dbapi
import adbc_driver_sqlite.dbapi

Connects to an in-memory SQLite database (or a specified URI), creates a table, inserts data, and fetches results as an Arrow Table using the DBAPI 2.0 interface.

import adbc_driver_sqlite.dbapi import os db_uri = os.environ.get('ADBC_SQLITE_URI', 'file::memory:?cache=shared') with adbc_driver_sqlite.dbapi.connect(uri=db_uri) as conn: with conn.cursor() as cur: cur.execute("CREATE TABLE IF NOT EXISTS users (id INTEGER, name TEXT)") cur.execute("INSERT INTO users (id, name) VALUES (?, ?)", (1, 'Alice')) cur.execute("INSERT INTO users (id, name) VALUES (?, ?)", (2, 'Bob')) cur.execute("SELECT * FROM users") result = cur.fetch_arrow_table() print(result)
Debug
Known issues
gotchaWhen connecting to an in-memory SQLite database by omitting the 'uri' parameter or using ':memory:', all connections will share the same database. To create distinct in-memory databases, use a URI like 'file::memory:?cache=shared' with a unique identifier or explicitly close connections.
fix
Use unique URI filenames (e.g., 'file:mydatabase?mode=memory&cache=shared') or manage connection lifecycles carefully for in-memory databases.
affects: All
gotchaSQLite's dynamic typing can lead to 'Type Promotion' and potential errors during ADBC's Arrow type inference. The driver infers types from the first batch of rows; subsequent batches attempting to convert to incompatible types will raise an error.
fix
Ensure consistent data types within columns, especially when ingesting or querying large datasets with varying data. The `adbc.sqlite.query.batch_rows` option can influence how many rows are used for initial type inference.
affects: All
gotchaModifying SQLite PRAGMA settings that affect transaction state (e.g., `PRAGMA journal_mode`) may fail if executed within an implicit transaction. The ADBC Python API implicitly wraps statements in transactions.
fix
Execute an explicit `COMMIT;` (or `ROLLBACK;`) before attempting to change such PRAGMA settings. Alternatively, ensure `autocommit=True` is set during connection for specific scenarios.
affects: All
gotchaSQLite user-defined functions (UDFs) registered with the underlying `sqlite3` module are not directly accessible through `adbc-driver-sqlite` connections, even if they share the same in-memory database. This is due to how ADBC manages its connection to the SQLite C driver.
fix
If UDFs are critical, consider using the native `sqlite3` module directly or explore if ADBC's C++ driver offers mechanisms for UDF registration that can be exposed via Python bindings in future versions.
affects: All
gotchaLoading SQLite extensions requires specific connection options (`adbc.sqlite.load_extension.enabled`, `adbc.sqlite.load_extension.path`, `adbc.sqlite.load_extension.entrypoint`) to be set on the connection *after* the connection is initialized, or by using specific methods on `AdbcSqliteConnection`.
fix
Consult the ADBC SQLite driver documentation for the correct sequence of setting options or calling `enable_load_extension` and `load_extension` methods to properly load SQLite extensions.
affects: All
gotchaThe underlying C++ SQLite driver library (`libadbc_driver_sqlite.so` on Linux, `.dylib` on macOS, `.dll` on Windows) must be discoverable by the Python package at runtime. If not installed via system package managers or not in a standard search path, this can cause import or connection errors.
fix
Ensure the library is in a system-wide search path (e.g., `/usr/local/lib`) or add its directory to `LD_LIBRARY_PATH` (Linux/macOS) or `PATH` (Windows) environment variables before running Python.
affects: All
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'adbc_driver_sqlite'
The 'adbc_driver_sqlite' module is not installed in the Python environment.
fix
Install the module using pip: 'pip install adbc-driver-sqlite'.
ImportError: cannot import name 'connect' from 'adbc_driver_sqlite'
The 'connect' function is located in the 'adbc_driver_sqlite.dbapi' submodule, not directly in 'adbc_driver_sqlite'.
fix
Import the function correctly: 'from adbc_driver_sqlite.dbapi import connect'.
AttributeError: module 'adbc_driver_sqlite.dbapi' has no attribute 'fetch_arrow_table'
The 'fetch_arrow_table' method is available on the cursor object, not directly in the 'adbc_driver_sqlite.dbapi' module.
fix
Use the method on a cursor object: 'cursor.fetch_arrow_table()'.
TypeError: connect() got an unexpected keyword argument 'database'
The 'connect' function in 'adbc_driver_sqlite.dbapi' uses 'uri' as the parameter name, not 'database'.
fix
Use the correct parameter name: 'connect(uri="your_database_uri")'.
ValueError: invalid URI: 'your_database_uri'
The provided URI is not valid or the database file does not exist.
fix
Ensure the URI is correct and the database file exists at the specified location.
Upgrade
Version history
1.12.0latest on PyPI · released Jul 28, 2026
Audit
Dependencies
adbc-driver-managerrequiredRequired for the Python bindings and DBAPI 2.0 interface.
pyarrowoptionalOptional, but recommended for using the DBAPI 2.0 interface to retrieve Arrow Table objects instead of row-oriented results.
Agent activity
61 hits · last 30 days
node
52
OpenAI (training)
1
Resources
adbc-driver-sqlite — pip install adbc-driver-sqlite · libregistry