Query functions in the ADBC Scanner DuckDB extension
Function category
Query
2 functionsRead arbitrary SQL results with adbc_scan or named tables with adbc_scan_table.
Signature
Arguments
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
database
|
Type
VARCHAR
|
Mode Positional | Description Alias of an ATTACH … (TYPE adbc) database. Unknown or non-ADBC names fail at bind. |
Argument
query
|
Type
VARCHAR
|
Mode Positional | Description |
Argument
params
|
Type
ANY
|
Mode Named | Description Parameter values as a STRUCT, such as row(1). |
Argument
batch_size
|
Type
BIGINT
|
Mode Named | Description Requested rows per batch; support depends on the driver. |
Argument
columns
|
Type
ANY
|
Mode Named | Description Complete ordered result schema, such as {'id': 'BIGINT'}. Required when ExecuteSchema is unsupported. |
Returns
Columns follow the complete remote result schema, inferred from driver metadata or supplied with columns.
Dynamic schema. The output columns are determined at bind time and vary per call, so they aren't listed here.
Description
Run SQL on an attached ADBC database and stream its result as a DuckDB table. Planning uses ExecuteSchema and never executes the query to infer columns. Drivers without ExecuteSchema, including SQLite, require a columns STRUCT declaring the complete ordered result schema.
ATTACH ':memory:' AS db (TYPE adbc, driver 'sqlite');
SELECT * FROM adbc_scan('db', 'SELECT 1 AS id', columns := {'id': 'BIGINT'});
DETACH db;
Signature
Arguments
| Argument | Type | Mode | Description |
|---|---|---|---|
Argument
database
|
Type
VARCHAR
|
Mode Positional | Description Alias of an ATTACH … (TYPE adbc) database. Unknown or non-ADBC names fail at bind. |
Argument
table_name
|
Type
VARCHAR
|
Mode Positional | Description |
Argument
catalog
|
Type
VARCHAR
|
Mode Named | Description Remote catalog name. |
Argument
schema
|
Type
VARCHAR
|
Mode Named | Description Remote schema name. |
Argument
batch_size
|
Type
BIGINT
|
Mode Named | Description Requested rows per batch. |
Argument
columns
|
Type
ANY
|
Mode Named | Description Optional complete ordered schema override. |
Returns
Columns follow the complete remote result schema, inferred from driver metadata or supplied with columns.
Dynamic schema. The output columns are determined at bind time and vary per call, so they aren't listed here.
Description
Read a named table using GetTableSchema metadata and a generated SELECT with supported projection and filter pushdown. Supply columns to override unavailable or unsuitable metadata.
ATTACH ':memory:' AS db (TYPE adbc, driver 'sqlite');
CALL adbc_execute('db', 'CREATE TABLE users(id INTEGER, name TEXT)');
SELECT * FROM adbc_scan_table('db', 'users');
DETACH db;