Skip to content

Query functions in the ADBC Scanner DuckDB extension

Function category

Query

2 functions

Read data from the remote database — full SQL queries (`adbc_scan`) or whole-table streams (`adbc_scan_table`).

adbc_scan

Table function Query
Signature
adbc_scan( batch_size := BIGINT, connection_handle := BIGINT, params := ANY, query := VARCHAR ) None
Arguments (Named)
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
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');

adbc_scan_table

Table function Query
Signature
adbc_scan_table( batch_size := BIGINT, catalog := VARCHAR, connection_handle := BIGINT, schema := VARCHAR, table_name := VARCHAR ) None
Arguments (Named)
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
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');