Skip to content

Query functions in the ADBC Scanner DuckDB extension

Function category

Query

2 functions

adbc_scan

Table function Query
Signature
adbc_scan( database: VARCHAR, query: VARCHAR, batch_size := BIGINT, columns := ANY, params := ANY ) → TABLE
Arguments
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

Dynamic schema. The output columns are determined at bind time and vary per call, so they aren't listed here.

Description
1 SQLite example
ATTACH ':memory:' AS db (TYPE adbc, driver 'sqlite');
SELECT * FROM adbc_scan('db', 'SELECT 1 AS id', columns := {'id': 'BIGINT'});
DETACH db;

adbc_scan_table

Table function Query
Signature
adbc_scan_table( database: VARCHAR, table_name: VARCHAR, batch_size := BIGINT, catalog := VARCHAR, columns := ANY, schema := VARCHAR ) → TABLE
Arguments
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

Dynamic schema. The output columns are determined at bind time and vary per call, so they aren't listed here.

Description
1 SQLite example
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;