Query functions in the ADBC Scanner DuckDB extension
Function category
Query
2 functionsRead data from the remote database — full SQL queries (`adbc_scan`) or whole-table streams (`adbc_scan_table`).
Signature
adbc_scan(
batch_size := BIGINT,
connection_handle := BIGINT,
params := ANY,
query := VARCHAR
) → None
Arguments (Named)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
connection_handle
|
Type
BIGINT
|
Mode Named | Description |
Argument
query
|
Type
VARCHAR
|
Mode Named | Description |
Argument
params
|
Type
ANY
|
Mode Named | Description |
Argument
batch_size
|
Type
BIGINT
|
Mode Named | Description |
Description
Execute a SELECT and return its rows as a DuckDB table. The headline read function — pass a SQL string and a connection handle.
1
Run a query through a stored connection handle
SET VARIABLE conn = (SELECT adbc_connect({'driver': 'sqlite', 'uri': ':memory:'}));
SELECT * FROM adbc_scan(getvariable('conn')::BIGINT, 'SELECT 1 AS id');
Signature
adbc_scan_table(
batch_size := BIGINT,
catalog := VARCHAR,
connection_handle := BIGINT,
schema := VARCHAR,
table_name := VARCHAR
) → None
Arguments (Named)
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
connection_handle
|
Type
BIGINT
|
Mode Named | Description |
Argument
table_name
|
Type
VARCHAR
|
Mode Named | Description |
Argument
catalog
|
Type
VARCHAR
|
Mode Named | Description |
Argument
schema
|
Type
VARCHAR
|
Mode Named | Description |
Argument
batch_size
|
Type
BIGINT
|
Mode Named | Description |
Description
Stream an entire remote table by name, without writing SQL — equivalent to adbc_scan(conn, 'SELECT * FROM <table>') but routed through ADBC's bulk-read API where supported.
1
Scan a remote table by name
SET VARIABLE conn = (SELECT adbc_connect({'driver': 'sqlite', 'uri': ':memory:'}));
SELECT adbc_execute(getvariable('conn')::BIGINT, 'CREATE TABLE users(id INTEGER)');
SELECT * FROM adbc_scan_table(getvariable('conn')::BIGINT, 'users');