ADBC SQLite Driver

1.11.0 · active · verified Sat Apr 11

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.

Warnings

Install

Imports

Quickstart

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)

view raw JSON →