Standard plugin ยท import "adbc"

Database connections

Use Arrow Database Connectivity drivers to read query results into Ibex, reuse database sessions, and write tables back to a database.

adbc::read

adbc::read(driver: String, uri: String, sql: String, options: String = "") -> DataFrame

Opens a driver connection, runs one query, reads its result, and closes the connection. Use it when a query does not need session state or multiple statements.

import "adbc";

let result = adbc::read(
    "sqlite", "data/market.sqlite",
    "select symbol, price from quotes"
);

Connection API

adbc::connect(driver, uri, options = "") returns an adbc::Connection. Pass it to these operations:

FunctionPurpose
query(db, sql, params = Table {})Run a query and return its rows as a DataFrame.
execute(db, sql, params = Table {})Run a statement such as DDL or an insert; return the affected row count, or -1 when the driver does not report one.
write(db, df, table, mode = "create")Bulk-write a DataFrame. Modes are create, append, replace, and create_append.
tables(db) / table_schema(db, table, schema = "", catalog = "")Discover visible tables and inspect reported column metadata.
begin(db) / commit(db) / rollback(db)Control a transaction. Transactions do not nest.
close(db)Close the connection; also closes automatically when its last binding goes away.

The optional params table binds values by column position to SQL placeholders (for example, ? in SQLite or $1 in PostgreSQL). The statement runs once per parameter row; a zero-row parameter table runs it zero times.

let db = adbc::connect("sqlite", ":memory:");
adbc::execute(db, "create table items (id integer, label text)");
let items = adbc::query(db, "select * from items");
adbc::close(db);

Driver options are a semicolon- or newline-separated string of key=value entries. Prefixes such as db., conn., and stmt. select the option scope. Driver availability and URI formats depend on the installed ADBC driver.

Connection lifecycle and examples

Connections are typed resources: they can be bound and passed to functions, but are not table data or scalar values. An open transaction is rolled back if the connection closes. The connections guide covers aliasing, lifetime, transactions, discovery, and driver setup in detail.