You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+41-5Lines changed: 41 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,16 +15,41 @@ There is also a checkout of the Airport DuckDB extension under ./airport. The Ai
15
15
The extension provides the following functions:
16
16
17
17
### Connection Management
18
-
-`adbc_connect(options)` - Connect to an ADBC data source. Returns a connection handle (BIGINT). Options can be passed as a STRUCT (preferred) or MAP. The `driver` option is required.
18
+
-`adbc_connect(options)` - Connect to an ADBC data source. Returns a connection handle (BIGINT). Options can be passed as a STRUCT (preferred) or MAP.
19
+
-**Required options:**
20
+
-`driver` - Driver name, path to shared library, or path to manifest file (.toml)
21
+
-**Optional options:**
22
+
-`entrypoint` - Custom entry point function name
23
+
-`search_paths` - Additional paths to search for driver manifests (colon-separated on Unix, semicolon on Windows)
24
+
-`use_manifests` - Enable/disable manifest search (default: 'true'). Set to 'false' to only use direct library paths.
25
+
- Other options are passed directly to the ADBC driver
19
26
-`adbc_disconnect(handle)` - Disconnect from an ADBC data source. Returns true on success.
20
27
28
+
#### Driver Manifest Support
29
+
The extension supports ADBC driver manifests, which allow referencing drivers by name instead of full paths. When `use_manifests` is enabled (default), the driver manager searches for manifests in these locations:
A manifest file is a TOML file (e.g., `sqlite.toml`) containing driver metadata and the path to the shared library.
45
+
21
46
### Transaction Control
22
47
-`adbc_set_autocommit(handle, enabled)` - Enable or disable autocommit mode. When disabled, changes require explicit commit.
23
48
-`adbc_commit(handle)` - Commit the current transaction.
24
49
-`adbc_rollback(handle)` - Rollback the current transaction, discarding all uncommitted changes.
25
50
26
51
### Query Execution
27
-
-`adbc_scan(handle, query, [params := row(...)])` - Execute a SELECT query and return results as a table. Supports parameterized queries via the optional `params` named parameter.
52
+
-`adbc_scan(handle, query, [params := row(...)], [batch_size := N])` - Execute a SELECT query and return results as a table. Supports parameterized queries via the optional `params` named parameter. The optional `batch_size` parameter hints to the driver how many rows to return per batch (default: driver-specific, typically 2048). This is a best-effort hint that may be ignored by drivers that don't support it.
SELECT*FROM adbc_scan(getvariable('conn')::BIGINT, 'SELECT 1 AS a, 2 AS b');
46
77
47
78
-- Parameterized query
48
79
SELECT*FROM adbc_scan(getvariable('conn')::BIGINT, 'SELECT ? AS value', params := row(42));
49
80
81
+
-- Query with batch size hint (for network drivers, larger batches reduce round-trips)
82
+
SELECT*FROM adbc_scan(getvariable('conn')::BIGINT, 'SELECT * FROM large_table', batch_size :=65536);
83
+
50
84
-- Execute DDL/DML
51
85
SELECT adbc_execute(getvariable('conn')::BIGINT, 'CREATE TABLE test (id INTEGER, name TEXT)');
52
86
SELECT adbc_execute(getvariable('conn')::BIGINT, 'INSERT INTO test VALUES (1, ''hello'')');
@@ -103,10 +137,12 @@ make test
103
137
# Run debug tests
104
138
make test_debug
105
139
106
-
# Run tests with SQLite driver (requires ADBC_SQLITE_DRIVER env var)
107
-
ADBC_SQLITE_DRIVER="/path/to/libadbc_driver_sqlite.dylib" make test
140
+
# Run tests with SQLite driver (requires both environment variables)
141
+
HAS_ADBC_SQLITE_DRIVER=1 make test
108
142
```
109
143
144
+
**Note:** Tests that use the SQLite ADBC driver require the `HAS_ADBC_SQLITE_DRIVER` environment variable to be set (to any value) in addition to `ADBC_SQLITE_DRIVER` pointing to the driver library path.
145
+
110
146
Tests are written as [SQLLogicTests](https://duckdb.org/dev/sqllogictest/intro.html) in `test/sql/`.
0 commit comments