Connection functions in the ADBC Scanner DuckDB extension
Function category
Connection
4 functionsOpen, close, and inspect ADBC connections. Every other function takes a BIGINT connection handle returned by `adbc_connect`.
Signature
adbc_clear_cache() → BOOLEAN
Description
Drop any cached driver / connection state. Useful after dynamic driver loading or when libraries are swapped.
1
Example 1
SELECT adbc_clear_cache();
Output
| adbc_clear_cache() |
|---|
| false |
Signature
adbc_connect(options: ANY) → BIGINT
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
options
|
Type
ANY
|
Mode Positional | Description |
Description
Open a connection to a remote database via an ADBC driver. Pass a STRUCT/MAP with at least driver and uri. Returns a BIGINT connection handle that every subsequent function call uses.
1
Example 1
SELECT adbc_connect({'driver': 'sqlite', 'uri': ':memory:'});
Output
| adbc_connect(main.struct_pack(driver := 'sqlite', uri := ':memory:')) |
|---|
| 105553167043096 |
2
Example 2
SELECT adbc_connect({'driver': '/path/to/driver.so', 'uri': 'connection_string'});
Signature
adbc_disconnect(connection_handle: BIGINT) → BOOLEAN
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
connection_handle
|
Type
BIGINT
|
Mode Positional | Description |
Description
Close a connection opened with adbc_connect and free its resources.
1
Example 1
SELECT adbc_disconnect(connection_handle);
Signature
adbc_info(connection_handle := BIGINT) → None
Arguments (Named)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
connection_handle
|
Type
BIGINT
|
Mode Named | Description |
Description
Return driver and server metadata for an open connection — vendor name, version strings, supported features.
1
Inspect the active connection
SET VARIABLE conn = (SELECT adbc_connect({'driver': 'sqlite', 'uri': ':memory:'}));
SELECT * FROM adbc_info(getvariable('conn')::BIGINT);