Skip to content

dlt

Run dlt sources - the declarative rest_api source or any @dlt.source

Connector software
Free and open source
Service credentials
Required
Use with an agent

Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.

npx skills add Query-farm/vgi-skills --skill orchard

Copy this request into your coding agent to get started.

Use https://query.farm/products/orchard/connectors/dlt/index.md to help me query dlt with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.

List the resources a rest_api config defines

Uses your connected account. Set up the connector and credentials to run it with your data.

SELECT name, primary_key, incremental_cursor
FROM dlt.main.resources('rest_api', config := '{"client": {"base_url": "https://pokeapi.co/api/v2/"}, "resources": ["pokemon", "berry"]}')
ORDER BY name

Quick start

Choose where to run dlt, then follow the steps below.

The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.

1. Install the vgi extension

Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.

setup.sql
SET allow_extension_repositories = 'allowed';

CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
    WITH PREFIX 'https://duckdb-extensions.query.farm';

INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;

2. Attach the connector

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'dlt' AS dlt (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-dlt-worker'
);

3. Add service credentials

After attaching, create the secret for the service you want to query in the same SQL session. Replace the placeholders with your service settings.

dlt credentials

Credentials and config for a dlt source, kept in memory and handed to dlt's config resolution.

Get these credentials →
secret.sql
CREATE SECRET dlt (
    TYPE dlt,
    config '<DLT_CONFIG>'  -- required, secret
);
Credential fields and requirements →

4. Run a query

query.sql
SELECT name, primary_key, incremental_cursor
FROM dlt.main.resources('rest_api', config := '{"client": {"base_url": "https://pokeapi.co/api/v2/"}, "resources": ["pokemon", "berry"]}')
ORDER BY name
More example queries →
Technical details
Verified connector release
v0.2.0
Engine
2.0.1
VGI protocol
3.4.0
Verified on
December 1, 2026
Release notes on GitHub
Pin a version for production

When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'dlt' AS dlt (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-dlt-worker'
);

Overview

Run dlt (dlthub) sources from DuckDB without a pipeline: the declarative rest_api source covers most REST APIs with a JSON config, and any @dlt.source package loads in an isolated environment.

ATTACH options

source
'rest_api' or 'package.module:function'. Every selected resource becomes a table.VARCHAR
config
The rest_api JSON config or the source function's keyword arguments: JSON or a path.VARCHAR
columns
Column types per resource, {"resource": {"column": "TYPE"}}: JSON or a path.VARCHAR
source_path
Directory to import a module source from (the function argument `path`).VARCHAR
pip_url
pip requirement(s) installed into an isolated cached environment.VARCHAR
python
Python version for the pip_url environment, e.g. '3.12'.VARCHAR
secret_name
Name of the dlt secret to use; empty picks it by SCOPE.VARCHAR
timeout_seconds
Stop a source that produces nothing for this many seconds; 0 waits forever.BIGINT

Catalog

Everything dlt exposes once attached — read straight from the worker's released build.

dlt 1 schema
main 8 functions

Functions that run dlt sources; attached source resources appear here as tables.

Schema examples (9)
Examples (9)

List the resources a rest_api config defines

SELECT name, primary_key, incremental_cursor
FROM dlt.main.resources('rest_api', config := '{"client": {"base_url": "https://pokeapi.co/api/v2/"}, "resources": ["pokemon", "berry"]}')
ORDER BY name;

The column types a public REST endpoint's items map to

SELECT column_name, data_type
FROM dlt.main.infer_columns('rest_api', resource := 'pokemon', config := '{"client": {"base_url": "https://pokeapi.co/api/v2/"}, "resources": ["pokemon"]}')
ORDER BY ordinal;

Which resources the inferred ATTACH columns cover

SELECT json_keys(columns) AS resources
FROM dlt.main.columns_json('rest_api', config := '{"client": {"base_url": "https://pokeapi.co/api/v2/"}, "resources": ["pokemon", "berry"]}');

The five most-starred repositories of a GitHub organization via the rest_api source

SELECT name, stargazers_count
FROM dlt.main.read_resource('rest_api', 'repos', config := '{"client": {"base_url": "https://api.github.com/"}, "resources": [{"name": "repos", "endpoint": {"path": "orgs/dlt-hub/repos"}}]}')
ORDER BY stargazers_count DESC
LIMIT 5;
5 more examples

Count recently updated issues with a `dlt init github` verified source

SELECT count(*) AS issues
FROM dlt.main.read_resource('github:github_reactions', 'issues', path := '/srv/dlt_project', config := '{"owner": "dlt-hub", "name": "dlt"}')
WHERE updated_at >= TIMESTAMPTZ '2026-01-01';

Explore raw GitHub API items and pull one field out of the JSON

SELECT item->>'$.login' AS login
FROM dlt.main.read_items('rest_api', 'members', config := '{"client": {"base_url": "https://api.github.com/"}, "resources": [{"name": "members", "endpoint": {"path": "orgs/dlt-hub/public_members"}}]}')
ORDER BY login
LIMIT 10;

Read GitHub issues updated since a date and keep the cursor to resume from

SELECT items, last_value
FROM dlt.main.final_state('rest_api', 'issues', config := '{"client": {"base_url": "https://api.github.com/repos/dlt-hub/dlt/"}, "resources": [{"name": "issues", "endpoint": {"path": "issues", "params": {"since": {"type": "incremental", "cursor_path": "updated_at", "initial_value": "2026-01-01T00:00:00Z"}}}}]}');

Normalize a decimal type text the way a columns override reads it

SELECT dlt.main.column_type('decimal(18,2)') AS duckdb_type;

See what a nested API object becomes before reading the resource

SELECT dlt.main.infer_type('{"user": {"login": "ada"}, "labels": ["bug"]}') AS duckdb_type;
Scalar functions
column_type (type_text VARCHAR) 2 examples

The DuckDB type a dlt data type (or a DuckDB type text) becomes in read_resource

Arguments
type_text VARCHAR
A dlt data type name or a DuckDB type text; NULL in, NULL out.
ReturnsVARCHAR
Examples (2)

Normalize a decimal type text the way a columns override reads it

SELECT dlt.main.column_type('decimal(18,2)') AS duckdb_type;
SELECT t, dlt.main.column_type(t) AS duckdb_type
FROM (VALUES ('bigint'), ('text'), ('timestamp'), ('struct(login varchar)')) v(t)
ORDER BY t;
Link
infer_type (json_value VARCHAR) 2 examples

The DuckDB type read_resource infers for a JSON value an item carries

Arguments
json_value VARCHAR
One item value as JSON text; NULL in, NULL out.
ReturnsVARCHAR
Examples (2)

See what a nested API object becomes before reading the resource

SELECT dlt.main.infer_type('{"user": {"login": "ada"}, "labels": ["bug"]}') AS duckdb_type;
SELECT dlt.main.infer_type(v) AS duckdb_type
FROM (VALUES ('{"login": "ada", "id": 1}'), ('"2026-01-01T00:00:00Z"'), ('["bug", "ui"]')) t(v)
ORDER BY duckdb_type;
Link
Table functions
columns_json (source VARCHAR, config := VARCHAR, path := VARCHAR, pip_url := VARCHAR, python := VARCHAR, resource := VARCHAR, sample_rows := BIGINT, secret_name := VARCHAR, timeout_seconds := BIGINT) 1 example

Infer every resource's columns and return them as JSON for the ATTACH columns option

Positional arguments
source VARCHAR
'rest_api' for dlt's declarative REST API source, or 'package.module:function' naming a @dlt.source function.
Named arguments
config := VARCHAR
JSON: the rest_api config (client, paginator, resources), or keyword arguments for a module source function. A path to a .json file also works. Put credentials in a dlt secret instead. · default ""
path := VARCHAR
Directory to import the source module from, e.g. a `dlt init` project. · default ""
pip_url := VARCHAR
pip requirement(s) providing the source, installed once into an isolated cached environment with dlt, e.g. 'dlt-source-foo==1.0' or a git URL. · default ""
python := VARCHAR
Python version for the pip_url environment, e.g. '3.12'; empty = default. · default ""
resource := VARCHAR
Only this resource; empty = every resource the source selects. · default ""
sample_rows := BIGINT
Items read from each resource to infer types. · default 100
secret_name := VARCHAR
Name of the dlt secret to use; empty picks the one whose SCOPE best matches the source. · default ""
timeout_seconds := BIGINT
Stop the source if it produces nothing for this many seconds; 0 waits forever. · default 300
Returns columns
columns JSON
JSON object {"resource": {"column": "DUCKDB TYPE", ...}, ...} for the ATTACH columns option.
Example

Which resources the inferred ATTACH columns cover

SELECT json_keys(columns) AS resources
FROM dlt.main.columns_json('rest_api', config := '{"client": {"base_url": "https://pokeapi.co/api/v2/"}, "resources": ["pokemon", "berry"]}');
Link
final_state (source VARCHAR, resource VARCHAR, config := VARCHAR, end_value := VARCHAR, initial_value := VARCHAR, path := VARCHAR, pip_url := VARCHAR, python := VARCHAR, secret_name := VARCHAR, state := VARCHAR, timeout_seconds := BIGINT) 1 example

Run a dlt resource to the end and return its incremental state and item count

Positional arguments
source VARCHAR
'rest_api' for dlt's declarative REST API source, or 'package.module:function' naming a @dlt.source function.
resource VARCHAR
Name of the resource to read, as listed by dlt.main.resources.
Named arguments
config := VARCHAR
JSON: the rest_api config (client, paginator, resources), or keyword arguments for a module source function. A path to a .json file also works. Put credentials in a dlt secret instead. · default ""
end_value := VARCHAR
Stop the incremental cursor before this value (exclusive); empty = none. · default ""
initial_value := VARCHAR
Start the resource's incremental cursor here (overrides its initial_value). A JSON number is passed as a number, anything else as a string such as '2026-01-01T00:00:00Z'. · default ""
path := VARCHAR
Directory to import the source module from, e.g. a `dlt init` project. · default ""
pip_url := VARCHAR
pip requirement(s) providing the source, installed once into an isolated cached environment with dlt, e.g. 'dlt-source-foo==1.0' or a git URL. · default ""
python := VARCHAR
Python version for the pip_url environment, e.g. '3.12'; empty = default. · default ""
secret_name := VARCHAR
Name of the dlt secret to use; empty picks the one whose SCOPE best matches the source. · default ""
state := VARCHAR
Resource state JSON to resume from, e.g. the state column of dlt.main.final_state; empty = fresh. · default ""
timeout_seconds := BIGINT
Stop the source if it produces nothing for this many seconds; 0 waits forever. · default 300
Returns columns
resource VARCHAR
The resource that was read.
items BIGINT
Items the resource yielded in this run.
incremental_cursor VARCHAR
The resource's incremental cursor column, if any.
last_value VARCHAR
The incremental cursor's last value after the run, if any.
state JSON
The resource state after the run (incremental last_value and dedup hashes); pass it as `state`.
Example

Read GitHub issues updated since a date and keep the cursor to resume from

SELECT items, last_value
FROM dlt.main.final_state('rest_api', 'issues', config := '{"client": {"base_url": "https://api.github.com/repos/dlt-hub/dlt/"}, "resources": [{"name": "issues", "endpoint": {"path": "issues", "params": {"since": {"type": "incremental", "cursor_path": "updated_at", "initial_value": "2026-01-01T00:00:00Z"}}}}]}');
Link
infer_columns (source VARCHAR, config := VARCHAR, path := VARCHAR, pip_url := VARCHAR, python := VARCHAR, resource := VARCHAR, sample_rows := BIGINT, secret_name := VARCHAR, timeout_seconds := BIGINT) 1 example

Sample each resource of a dlt source and report the DuckDB column types it maps to

Positional arguments
source VARCHAR
'rest_api' for dlt's declarative REST API source, or 'package.module:function' naming a @dlt.source function.
Named arguments
config := VARCHAR
JSON: the rest_api config (client, paginator, resources), or keyword arguments for a module source function. A path to a .json file also works. Put credentials in a dlt secret instead. · default ""
path := VARCHAR
Directory to import the source module from, e.g. a `dlt init` project. · default ""
pip_url := VARCHAR
pip requirement(s) providing the source, installed once into an isolated cached environment with dlt, e.g. 'dlt-source-foo==1.0' or a git URL. · default ""
python := VARCHAR
Python version for the pip_url environment, e.g. '3.12'; empty = default. · default ""
resource := VARCHAR
Only this resource; empty = every resource the source selects. · default ""
sample_rows := BIGINT
Items read from each resource to infer types. · default 100
secret_name := VARCHAR
Name of the dlt secret to use; empty picks the one whose SCOPE best matches the source. · default ""
timeout_seconds := BIGINT
Stop the source if it produces nothing for this many seconds; 0 waits forever. · default 300
Returns columns
resource VARCHAR
Resource name.
ordinal INTEGER
Position of the column in the resource's table, from 1.
column_name VARCHAR
Column name (the item key).
data_type VARCHAR
DuckDB type read_resource uses for the column.
nullable BOOLEAN
False only for columns the hints declare NOT NULL.
origin VARCHAR
'hint' (dlt column hint) or 'sample' (inferred from items).
Example

The column types a public REST endpoint's items map to

SELECT column_name, data_type
FROM dlt.main.infer_columns('rest_api', resource := 'pokemon', config := '{"client": {"base_url": "https://pokeapi.co/api/v2/"}, "resources": ["pokemon"]}')
ORDER BY ordinal;
Link
read_items (source VARCHAR, resource VARCHAR, config := VARCHAR, end_value := VARCHAR, initial_value := VARCHAR, path := VARCHAR, pip_url := VARCHAR, python := VARCHAR, secret_name := VARCHAR, state := VARCHAR, timeout_seconds := BIGINT) 1 example

Return each item of a dlt resource as one JSON value, without typing or sampling

Positional arguments
source VARCHAR
'rest_api' for dlt's declarative REST API source, or 'package.module:function' naming a @dlt.source function.
resource VARCHAR
Name of the resource to read, as listed by dlt.main.resources.
Named arguments
config := VARCHAR
JSON: the rest_api config (client, paginator, resources), or keyword arguments for a module source function. A path to a .json file also works. Put credentials in a dlt secret instead. · default ""
end_value := VARCHAR
Stop the incremental cursor before this value (exclusive); empty = none. · default ""
initial_value := VARCHAR
Start the resource's incremental cursor here (overrides its initial_value). A JSON number is passed as a number, anything else as a string such as '2026-01-01T00:00:00Z'. · default ""
path := VARCHAR
Directory to import the source module from, e.g. a `dlt init` project. · default ""
pip_url := VARCHAR
pip requirement(s) providing the source, installed once into an isolated cached environment with dlt, e.g. 'dlt-source-foo==1.0' or a git URL. · default ""
python := VARCHAR
Python version for the pip_url environment, e.g. '3.12'; empty = default. · default ""
secret_name := VARCHAR
Name of the dlt secret to use; empty picks the one whose SCOPE best matches the source. · default ""
state := VARCHAR
Resource state JSON to resume from, e.g. the state column of dlt.main.final_state; empty = fresh. · default ""
timeout_seconds := BIGINT
Stop the source if it produces nothing for this many seconds; 0 waits forever. · default 300
Returns columns
item JSON
One item exactly as the resource yielded it, as a JSON object.
Example

Explore raw GitHub API items and pull one field out of the JSON

SELECT item->>'$.login' AS login
FROM dlt.main.read_items('rest_api', 'members', config := '{"client": {"base_url": "https://api.github.com/"}, "resources": [{"name": "members", "endpoint": {"path": "orgs/dlt-hub/public_members"}}]}')
ORDER BY login
LIMIT 10;
Link
read_resource (source VARCHAR, resource VARCHAR, columns := VARCHAR, config := VARCHAR, end_value := VARCHAR, initial_value := VARCHAR, path := VARCHAR, pip_url := VARCHAR, python := VARCHAR, sample_rows := BIGINT, secret_name := VARCHAR, state := VARCHAR, timeout_seconds := BIGINT) 2 examples

Run a dlt source (rest_api or any @dlt.source) and return one resource as a typed table

Positional arguments
source VARCHAR
'rest_api' for dlt's declarative REST API source, or 'package.module:function' naming a @dlt.source function.
resource VARCHAR
Name of the resource to read, as listed by dlt.main.resources.
Named arguments
columns := VARCHAR
JSON object mapping column names to type names (DuckDB or dlt); these take precedence over the resource's hints and over inference. · default ""
config := VARCHAR
JSON: the rest_api config (client, paginator, resources), or keyword arguments for a module source function. A path to a .json file also works. Put credentials in a dlt secret instead. · default ""
end_value := VARCHAR
Stop the incremental cursor before this value (exclusive); empty = none. · default ""
initial_value := VARCHAR
Start the resource's incremental cursor here (overrides its initial_value). A JSON number is passed as a number, anything else as a string such as '2026-01-01T00:00:00Z'. · default ""
path := VARCHAR
Directory to import the source module from, e.g. a `dlt init` project. · default ""
pip_url := VARCHAR
pip requirement(s) providing the source, installed once into an isolated cached environment with dlt, e.g. 'dlt-source-foo==1.0' or a git URL. · default ""
python := VARCHAR
Python version for the pip_url environment, e.g. '3.12'; empty = default. · default ""
sample_rows := BIGINT
Items read at bind time to infer columns the resource's hints do not type; 0 = hints and columns only. · default 100
secret_name := VARCHAR
Name of the dlt secret to use; empty picks the one whose SCOPE best matches the source. · default ""
state := VARCHAR
Resource state JSON to resume from, e.g. the state column of dlt.main.final_state; empty = fresh. · default ""
timeout_seconds := BIGINT
Stop the source if it produces nothing for this many seconds; 0 waits forever. · default 300
Returns columns
hinted `decimal` column DECIMAL(10,2)
a dlt column hint; `text`, `bigint`, `double`, `bool`, `timestamp`, `date`, `time`, `json`, `binary` map the same way (see column_type); primary keys are NOT NULL
integer key BIGINT
whole numbers
number key DOUBLE
numbers with a fraction (or mixed)
boolean key BOOLEAN
true / false
timestamp key TIMESTAMP WITH TIME ZONE
ISO-8601 strings with a time; offset-less values are UTC
date key DATE
ISO-8601 dates
text key VARCHAR
other strings
object key STRUCT(login VARCHAR, id BIGINT)
e.g. a nested user object; keys from the sample
array key VARCHAR[]
e.g. a list of labels; elements typed by the same rules
mixed key JSON
values of different types, or nesting deeper than 3 levels
Arrow `int32` column INTEGER
resources that yield Arrow tables keep their Arrow types
Returns columns · depends on the arguments
hinted `decimal` column DECIMAL(10,2)
a dlt column hint; `text`, `bigint`, `double`, `bool`, `timestamp`, `date`, `time`, `json`, `binary` map the same way (see column_type); primary keys are NOT NULL
integer key BIGINT
whole numbers
number key DOUBLE
numbers with a fraction (or mixed)
boolean key BOOLEAN
true / false
timestamp key TIMESTAMP WITH TIME ZONE
ISO-8601 strings with a time; offset-less values are UTC
date key DATE
ISO-8601 dates
text key VARCHAR
other strings
object key STRUCT(login VARCHAR, id BIGINT)
e.g. a nested user object; keys from the sample
array key VARCHAR[]
e.g. a list of labels; elements typed by the same rules
mixed key JSON
values of different types, or nesting deeper than 3 levels
Arrow `int32` column INTEGER
resources that yield Arrow tables keep their Arrow types
Examples (2)

The five most-starred repositories of a GitHub organization via the rest_api source

SELECT name, stargazers_count
FROM dlt.main.read_resource('rest_api', 'repos', config := '{"client": {"base_url": "https://api.github.com/"}, "resources": [{"name": "repos", "endpoint": {"path": "orgs/dlt-hub/repos"}}]}')
ORDER BY stargazers_count DESC
LIMIT 5;

Count recently updated issues with a `dlt init github` verified source

SELECT count(*) AS issues
FROM dlt.main.read_resource('github:github_reactions', 'issues', path := '/srv/dlt_project', config := '{"owner": "dlt-hub", "name": "dlt"}')
WHERE updated_at >= TIMESTAMPTZ '2026-01-01';
Link
resources (source VARCHAR, config := VARCHAR, path := VARCHAR, pip_url := VARCHAR, python := VARCHAR, secret_name := VARCHAR, timeout_seconds := BIGINT) 1 example

List the resources of a dlt source with keys, write disposition, incremental cursor and hints

Positional arguments
source VARCHAR
'rest_api' for dlt's declarative REST API source, or 'package.module:function' naming a @dlt.source function.
Named arguments
config := VARCHAR
JSON: the rest_api config (client, paginator, resources), or keyword arguments for a module source function. A path to a .json file also works. Put credentials in a dlt secret instead. · default ""
path := VARCHAR
Directory to import the source module from, e.g. a `dlt init` project. · default ""
pip_url := VARCHAR
pip requirement(s) providing the source, installed once into an isolated cached environment with dlt, e.g. 'dlt-source-foo==1.0' or a git URL. · default ""
python := VARCHAR
Python version for the pip_url environment, e.g. '3.12'; empty = default. · default ""
secret_name := VARCHAR
Name of the dlt secret to use; empty picks the one whose SCOPE best matches the source. · default ""
timeout_seconds := BIGINT
Stop the source if it produces nothing for this many seconds; 0 waits forever. · default 300
Returns columns
name VARCHAR
Resource name; pass it to read_resource.
table_name VARCHAR
Table name the resource's hints declare (often the resource name).
selected BOOLEAN
Whether the source selects the resource by default.
is_transformer BOOLEAN
True for a transformer fed by another resource.
parent VARCHAR
The resource feeding this transformer, if any.
write_disposition VARCHAR
append, replace or merge, from the resource hints.
primary_key VARCHAR[]
Primary key columns from the hints.
merge_key VARCHAR[]
Merge key columns from the hints.
incremental_cursor VARCHAR
Column the incremental cursor tracks, if the resource has one.
incremental_initial_value VARCHAR
The incremental cursor's default start value, as text.
incremental_end_value VARCHAR
The incremental cursor's default end value, as text.
columns STRUCT of 4 fields[]
Hinted columns: name, dlt data_type (NULL if only partly hinted), DuckDB type, nullable.
STRUCT[] 4 fields
  • nameVARCHAR
  • data_typeVARCHAR
  • duckdb_typeVARCHAR
  • nullableBOOLEAN
Example

List the resources a rest_api config defines

SELECT name, primary_key, incremental_cursor
FROM dlt.main.resources('rest_api', config := '{"client": {"base_url": "https://pokeapi.co/api/v2/"}, "resources": ["pokemon", "berry"]}')
ORDER BY name;
Link

Credentials

The secret type dlt declares, as reported by the worker itself.

dlt

How to get these credentials

Credentials and config for a dlt source, kept in memory and handed to dlt's config resolution.

secret.sql
CREATE SECRET dlt (
    TYPE dlt,
    config '<DLT_CONFIG>'  -- required, secret
);
Key Type Required Description
config secret VARCHAR Yes A JSON object or TOML text. For the rest_api source it is deep-merged into the REST config (e.g. {"client": {"auth": {"type": "bearer", "token": "..."}}}); for every source it is also read like dlt's secrets.toml (e.g. [sources.github] access_token). Bind it with SCOPE 'dlt://rest_api/<host>' or 'dlt://<package>/<module>/<function>' (or a prefix of it that ends at a '/').

Create the secret in the same session, after attaching dlt — the worker registers its secret types at ATTACH. Keys marked secret are masked in duckdb_secrets(); angle-bracket values are placeholders. Read credentials from your environment or secret store in your application and pass them through your SQL client’s parameter bindings. Keep real values out of saved SQL and history. Native DuckDB and Haybarn do not provide a SQL getenv() function.

Try these queries

The column types a public REST endpoint's items map to

SELECT column_name, data_type
FROM dlt.main.infer_columns('rest_api', resource := 'pokemon', config := '{"client": {"base_url": "https://pokeapi.co/api/v2/"}, "resources": ["pokemon"]}')
ORDER BY ordinal

Uses infer_columns

Which resources the inferred ATTACH columns cover

SELECT json_keys(columns) AS resources
FROM dlt.main.columns_json('rest_api', config := '{"client": {"base_url": "https://pokeapi.co/api/v2/"}, "resources": ["pokemon", "berry"]}')

Uses columns_json

The five most-starred repositories of a GitHub organization via the rest_api source

SELECT name, stargazers_count
FROM dlt.main.read_resource('rest_api', 'repos', config := '{"client": {"base_url": "https://api.github.com/"}, "resources": [{"name": "repos", "endpoint": {"path": "orgs/dlt-hub/repos"}}]}')
ORDER BY stargazers_count DESC
LIMIT 5

Uses read_resource

Explore raw GitHub API items and pull one field out of the JSON

SELECT item->>'$.login' AS login
FROM dlt.main.read_items('rest_api', 'members', config := '{"client": {"base_url": "https://api.github.com/"}, "resources": [{"name": "members", "endpoint": {"path": "orgs/dlt-hub/public_members"}}]}')
ORDER BY login
LIMIT 10

Uses read_items

Read GitHub issues updated since a date and keep the cursor to resume from

SELECT items, last_value
FROM dlt.main.final_state('rest_api', 'issues', config := '{"client": {"base_url": "https://api.github.com/repos/dlt-hub/dlt/"}, "resources": [{"name": "issues", "endpoint": {"path": "issues", "params": {"since": {"type": "incremental", "cursor_path": "updated_at", "initial_value": "2026-01-01T00:00:00Z"}}}}]}')

Uses final_state

Normalize a decimal type text the way a columns override reads it

SELECT dlt.main.column_type('decimal(18,2)') AS duckdb_type

Uses column_type

4 more examples in the Catalog, each listed under the table or function it uses.

dlt is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.