Skip to content

CloudQuery

Every CloudQuery source plugin's tables, streamed as Arrow, with secret-held specs

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/cloudquery/index.md to help me query CloudQuery 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.

Compare cloud resources by region

Attach an AWS CloudQuery plugin under the schema name aws and configure its credentials first. CloudQuery’s current AWS plugin also requires a CloudQuery account and an appropriate plan.

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

SELECT region, count(*) AS instances
FROM cloudquery.main.scan('aws', 'aws_ec2_instances')
GROUP BY region
ORDER BY instances DESC

Quick start

Choose where to run CloudQuery, 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 the release directly

Downloads the latest release for your platform and caches it locally.

ATTACH 'cloudquery' AS cloudquery (
  TYPE vgi,
  LOCATION 'github-auto://Query-farm/vgi-cloudquery'
);

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.

cloudquery credentials

Plugin spec for a hosted CloudQuery source plugin, typically its credentials: the JSON or YAML of the plugin's `spec:` block. Deep-merged over the ATTACH spec option at query time.

Get these credentials →
secret.sql
CREATE SECRET cloudquery (
    TYPE cloudquery,
    plugin '<plugin>',
    spec   '<CLOUDQUERY_SPEC>'  -- secret
);
cloudquery_hub credentials

CloudQuery Hub API key (the CLOUDQUERY_API_KEY equivalent): lets install_plugin download Hub plugins, which the Hub refuses to anonymous callers, and is passed to paid plugins that report usage.

Get these credentials →
secret.sql
CREATE SECRET cloudquery_hub (
    TYPE cloudquery_hub,
    api_key '<CLOUDQUERY_HUB_API_KEY>',  -- secret
    team    '<team>',
    hub_url '<hub_url>'
);
Credential fields and requirements →

4. Run a query

query.sql
SELECT region, count(*) AS instances
FROM cloudquery.main.scan('aws', 'aws_ec2_instances')
GROUP BY region
ORDER BY instances DESC
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 the release directly

Uses the verified release each time you attach the connector.

ATTACH 'cloudquery' AS cloudquery (
  TYPE vgi,
  LOCATION 'github-auto://Query-farm/[email protected]'
);

Overview

Host CloudQuery source plugins and query their tables from DuckDB: each plugin is a schema, each plugin table a table, streamed as Arrow from the plugin's sync. No CloudQuery CLI or destination database needed.

ATTACH options

plugins
Comma-separated CloudQuery source plugins to host, each `[schema=]ref`. A ref is a local plugin binary path, a CloudQuery Hub plugin (`cloudquery/[email protected]`, `hub:team/name`), a GitHub release (`github:cloudquery/[email protected]`), or a running plugin server (`grpc:host:port`); append `#sha256:<hex>` to pin an archive. Each plugin becomes a schema named after it (or `schema`), holding one table per plugin table.VARCHAR
spec
Non-secret plugin specs: a JSON or YAML object keyed by schema, each value the plugin's own `spec:` object (`{"hackernews": {"item_concurrency": 10}}`). Used to discover tables at ATTACH and for every query. Never put credentials here: use CREATE SECRET (TYPE cloudquery, ...).VARCHAR
cache_dir
Directory for downloaded plugins (default: <user cache dir>/vgi-cloudquery/plugins). Binaries are kept with their verified sha256 and reused offline.VARCHAR
hub_url
CloudQuery Hub API base URL (default https://api.cloudquery.io); for mirrors and tests.VARCHAR
github_url
Base URL GitHub release downloads come from (default https://github.com); for mirrors and tests.VARCHAR

Catalog

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

cloudquery 2 schemas
fixture 4 tables

CloudQuery source plugin fixture (/private/tmp/orchard-protocol34/assets/vgi-cloudquery-v0.2.0-cq-source-fixture-darwin_arm64), 4 tables. Version v1.0.0.

Schema examples (4)
Examples (4)

A few rows of fixture_flaky

SELECT n FROM cloudquery.fixture.fixture_flaky LIMIT 10;

A few rows of fixture_item

SELECT id, name, category FROM cloudquery.fixture.fixture_item LIMIT 10;

A few rows of fixture_item_event

SELECT item_id, seq, kind
FROM cloudquery.fixture.fixture_item_event
LIMIT 10;

A few rows of fixture_whoami

SELECT greeting, has_token, item_count
FROM cloudquery.fixture.fixture_whoami
LIMIT 10;
Tables
fixture_flaky 1 example3 cols

Emits three rows, then its resolver fails.

Columns
_cq_idnot null UUID
CloudQuery row id (deterministic: derived from the primary key). Primary key, unique.
_cq_parent_id UUID
The _cq_id of the parent row this row was fetched under (NULL for top-level tables).
n BIGINT
Plugin column n (CloudQuery type int64).
Example

A few rows of fixture_flaky

SELECT n FROM cloudquery.fixture.fixture_flaky LIMIT 10;
Link
fixture_item 1 example14 cols

Synthetic inventory items covering every CloudQuery column type the worker maps.

Columns
_cq_idnot null UUID
CloudQuery row id (deterministic: derived from the primary key). Unique.
_cq_parent_id UUID
The _cq_id of the parent row this row was fetched under (NULL for top-level tables).
idnot null BIGINT
Plugin column id (CloudQuery type int64). Primary key.
name VARCHAR
Plugin column name (CloudQuery type utf8).
category VARCHAR
Plugin column category (CloudQuery type utf8).
price DOUBLE
Plugin column price (CloudQuery type float64).
in_stock BOOLEAN
Plugin column in_stock (CloudQuery type bool).
created_at TIMESTAMP WITH TIME ZONE
Plugin column created_at (CloudQuery type timestamp[us, tz=UTC]).
item_uuid UUID
Plugin column item_uuid (CloudQuery type uuid).
attributes JSON
Plugin column attributes (CloudQuery type json).
ip VARCHAR
Plugin column ip (CloudQuery type inet).
mac VARCHAR
Plugin column mac (CloudQuery type mac).
tags VARCHAR[]
Plugin column tags (CloudQuery type list<utf8>).
related_uuids UUID[]
Plugin column related_uuids (CloudQuery type list<uuid>).
Example

A few rows of fixture_item

SELECT id, name, category FROM cloudquery.fixture.fixture_item LIMIT 10;
Link
fixture_item_event 1 example6 cols

Two events per item: a child relation of fixture_item. Child of fixture_item (join _cq_parent_id to its _cq_id).

Columns
_cq_idnot null UUID
CloudQuery row id (deterministic: derived from the primary key). Unique.
_cq_parent_id UUID
The _cq_id of the parent row this row was fetched under (NULL for top-level tables).
item_idnot null BIGINT
Plugin column item_id (CloudQuery type int64). Primary key.
seqnot null BIGINT
Plugin column seq (CloudQuery type int64). Primary key.
kind VARCHAR
Plugin column kind (CloudQuery type utf8).
at TIMESTAMP WITH TIME ZONE
Plugin column at (CloudQuery type timestamp[us, tz=UTC]).
Example

A few rows of fixture_item_event

SELECT item_id, seq, kind
FROM cloudquery.fixture.fixture_item_event
LIMIT 10;
Link
fixture_whoami 1 example5 cols

One row describing the spec the plugin was initialised with.

Columns
_cq_idnot null UUID
CloudQuery row id (deterministic: derived from the primary key). Primary key, unique.
_cq_parent_id UUID
The _cq_id of the parent row this row was fetched under (NULL for top-level tables).
greeting VARCHAR
Plugin column greeting (CloudQuery type utf8).
has_token BOOLEAN
Plugin column has_token (CloudQuery type bool).
item_count BIGINT
Plugin column item_count (CloudQuery type int64).
Example

A few rows of fixture_whoami

SELECT greeting, has_token, item_count
FROM cloudquery.fixture.fixture_whoami
LIMIT 10;
Link
main 3 tables · 2 functions

Introspection of the CloudQuery plugins this ATTACH hosts, plus direct scans and plugin installs.

Schema examples (6)
Examples (6)

Read a plugin table directly and aggregate it

SELECT category, count(*) AS items
FROM cloudquery.main.scan('fixture', 'fixture_item')
GROUP BY category
ORDER BY category;

Stop the plugin's sync after 10 rows

SELECT count(*) AS fetched
FROM cloudquery.main.scan('fixture', 'fixture_item', max_rows := 10);

Download the CloudQuery test plugin from its GitHub release into the cache

SELECT ref, plugin_version, archive_sha256, from_cache
FROM cloudquery.main.install_plugin('github:cloudquery/[email protected]');

The attached plugins and how many tables each serves

SELECT schema_name, plugin, plugin_version, table_count
FROM cloudquery.main.plugin
ORDER BY schema_name;
2 more examples

Child relations and their parents

SELECT schema_name, table_name, parent_table
FROM cloudquery.main.plugin_table
WHERE parent_table IS NOT NULL
ORDER BY ALL;

Columns with CloudQuery extension types and their DuckDB types

SELECT table_name, column_name, cloudquery_type, duckdb_type
FROM cloudquery.main.plugin_column
WHERE cloudquery_type IN ('uuid', 'json', 'inet', 'mac')
ORDER BY ALL;
Tables
plugin 1 example10 cols

The CloudQuery plugins of this ATTACH, one row per plugin schema, with versions, verified digests and table counts.

Columns
schema_name VARCHAR
Schema the plugin's tables live in.
pluginnot null VARCHAR
Plugin name, as the plugin reports it (e.g. hackernews).
refnot null VARCHAR
The plugin reference the ATTACH resolved: Hub or GitHub plugin, local binary path, or grpc address.
registrynot null VARCHAR
Where the plugin came from: cloudquery (Hub), github, local or grpc.
plugin_version VARCHAR
Version the plugin reports.
archive_sha256 VARCHAR
Verified sha256 of the downloaded archive; NULL for a local binary or grpc server.
binary_sha256 VARCHAR
sha256 of the unpacked binary, re-checked whenever the cache is reused; NULL when not downloaded.
binary_path VARCHAR
Executable the worker runs; NULL for a grpc server.
table_countnot null BIGINT
Number of tables the plugin serves (child relations included).
spec_schema JSON
JSON Schema of the plugin's spec, when the plugin publishes one.
ConstraintsPRIMARY KEY (schema_name)
Example

The attached plugins and how many tables each serves

SELECT schema_name, plugin, plugin_version, table_count
FROM cloudquery.main.plugin
ORDER BY schema_name;
Link
plugin_column 2 examples10 cols

Every column of every attached plugin table, with its CloudQuery type, the DuckDB type it is read as, and its key flags.

Columns
schema_name VARCHAR
Plugin schema.
table_name VARCHAR
Plugin table name.
column_name VARCHAR
The plugin column's identifier, as written in SQL against the plugin table.
ordinalnot null BIGINT
Position of the column in the table, counting from 1 (the plugin's column order).
cloudquery_typenot null VARCHAR
The column's CloudQuery (Arrow) type, e.g. utf8, int64, uuid, json, inet, list<uuid>.
duckdb_typenot null VARCHAR
The DuckDB type it is read as, e.g. VARCHAR, UUID, JSON.
nullablenot null BOOLEAN
Whether the column can be NULL.
is_primary_keynot null BOOLEAN
Whether the column is part of the plugin's primary key.
is_uniquenot null BOOLEAN
Whether the plugin declares the column unique.
incremental_keynot null BOOLEAN
Whether CloudQuery uses the column as an incremental cursor.
ConstraintsPRIMARY KEY (schema_name, table_name, column_name)
Examples (2)

Columns with CloudQuery extension types and their DuckDB types

SELECT table_name, column_name, cloudquery_type, duckdb_type
FROM cloudquery.main.plugin_column
WHERE cloudquery_type IN ('uuid', 'json', 'inet', 'mac')
ORDER BY ALL;

Extension-typed columns of fixture_item

SELECT column_name, duckdb_type
FROM cloudquery.main.plugin_column
WHERE table_name = 'fixture_item' AND cloudquery_type IN ('uuid', 'json', 'inet', 'mac') AND column_name NOT LIKE '\_cq%' ESCAPE '\'
ORDER BY ordinal;
Link
plugin_table 2 examples11 cols

Every table of the attached plugins, with its parent relation, child tables and primary key.

Columns
schema_name VARCHAR
Plugin schema.
table_name VARCHAR
Plugin table name.
title VARCHAR
The plugin's title for the table.
description VARCHAR
The plugin's description of the table.
parent_table VARCHAR
The table this one is a child relation of (rows are fetched per parent row); NULL for a top-level table.
child_tablesnot null VARCHAR[]
Tables fetched per row of this one.
column_countnot null BIGINT
Number of columns.
primary_key_columnsnot null VARCHAR[]
The plugin's primary key columns, in table order (empty when the table has none).
is_incrementalnot null BOOLEAN
Whether the table syncs incrementally in CloudQuery (this worker always reads it in full).
is_paidnot null BOOLEAN
Whether CloudQuery marks the table as paid.
permissions_needednot null VARCHAR[]
Cloud permissions the plugin says the table needs.
ConstraintsPRIMARY KEY (schema_name, table_name)
Examples (2)

Child relations and their parents

SELECT schema_name, table_name, parent_table
FROM cloudquery.main.plugin_table
WHERE parent_table IS NOT NULL
ORDER BY ALL;

Child relations of the fixture plugin

SELECT table_name, parent_table
FROM cloudquery.main.plugin_table
WHERE parent_table IS NOT NULL
ORDER BY table_name;
Link
Table functions
install_plugin (ref VARCHAR) 1 example

Download a CloudQuery Hub or GitHub plugin into the worker's verified plugin cache

Arguments
ref VARCHAR
Plugin to download: a Hub ref (cloudquery/[email protected] or hub:team/name for the latest version) or a GitHub ref (github:cloudquery/[email protected]); append #sha256:<hex> to pin the archive.
Returns columns
ref VARCHAR
The plugin reference, with the version it resolved to.
registry VARCHAR
cloudquery (Hub) or github.
plugin_version VARCHAR
The version downloaded or found in the cache.
archive_sha256 VARCHAR
sha256 of the archive, verified against the registry's published checksum.
binary_sha256 VARCHAR
sha256 of the unpacked plugin binary.
binary_path VARCHAR
Where the binary is cached.
source_url VARCHAR
Where the archive came from (query string removed).
from_cache BOOLEAN
True when the plugin was already cached and nothing was downloaded.
Example

Download the CloudQuery test plugin from its GitHub release into the cache

SELECT ref, plugin_version, archive_sha256, from_cache
FROM cloudquery.main.install_plugin('github:cloudquery/[email protected]');
Link
scan (schema VARCHAR, table VARCHAR, max_rows := BIGINT, strict := BOOLEAN) 2 examples

Read one table of an attached CloudQuery source plugin by running a sync of just that table

Positional arguments
schema VARCHAR
Plugin schema of this ATTACH, as named by the plugins option (e.g. 'hackernews').
table VARCHAR
Plugin table name (e.g. 'hackernews_items' or 'aws_s3_buckets').
Named arguments
max_rows := BIGINT
Stop the plugin's sync after this many rows of the table (0 = no limit). Cancels the remaining API calls; CloudQuery has no limit of its own. · default 0
strict := BOOLEAN
Fail the query when the plugin reports an error for a table it syncs. By default errors are logged and the rows fetched so far are returned (CloudQuery's own behaviour). · default false
Returns columns
_cq_id UUID
Row id, derived from the primary key.
_cq_parent_id UUID
The parent row's _cq_id (fixture_item).
item_id BIGINT
Parent item id.
seq BIGINT
Event number within the item.
kind VARCHAR
created or restocked.
at TIMESTAMP WITH TIME ZONE
When it happened.
Returns columns · depends on the arguments
_cq_id UUID
Row id, derived from the primary key.
_cq_parent_id UUID
The parent row's _cq_id (fixture_item).
item_id BIGINT
Parent item id.
seq BIGINT
Event number within the item.
kind VARCHAR
created or restocked.
at TIMESTAMP WITH TIME ZONE
When it happened.
Examples (2)

Read a plugin table directly and aggregate it

SELECT category, count(*) AS items
FROM cloudquery.main.scan('fixture', 'fixture_item')
GROUP BY category
ORDER BY category;

Stop the plugin's sync after 10 rows

SELECT count(*) AS fetched
FROM cloudquery.main.scan('fixture', 'fixture_item', max_rows := 10);
Link

Credentials

The 2 secret types cloudquery declares, as reported by the worker itself.

cloudquery

How to get these credentials

Plugin spec for a hosted CloudQuery source plugin, typically its credentials: the JSON or YAML of the plugin's `spec:` block. Deep-merged over the ATTACH spec option at query time.

secret.sql
CREATE SECRET cloudquery (
    TYPE cloudquery,
    plugin '<plugin>',
    spec   '<CLOUDQUERY_SPEC>'  -- secret
);
Key Type Required Description
plugin VARCHAR — Schema or plugin name the secret configures (e.g. 'github'); the secret is ignored for other plugins. Empty applies to any.
spec secret VARCHAR — The plugin spec as a JSON object ({"access_token": "..."}) or YAML (access_token: ...).

The worker doesn't mark which keys are required.

cloudquery_hub

How to get these credentials

CloudQuery Hub API key (the CLOUDQUERY_API_KEY equivalent): lets install_plugin download Hub plugins, which the Hub refuses to anonymous callers, and is passed to paid plugins that report usage.

secret.sql
CREATE SECRET cloudquery_hub (
    TYPE cloudquery_hub,
    api_key '<CLOUDQUERY_HUB_API_KEY>',  -- secret
    team    '<team>',
    hub_url '<hub_url>'
);
Key Type Required Description
api_key secret VARCHAR — CloudQuery API key, created in the CloudQuery Cloud console.
team VARCHAR — CloudQuery team name, for downloads made on a team's behalf (optional).
hub_url VARCHAR — Hub API base URL (default https://api.cloudquery.io); for mirrors and tests.

The worker doesn't mark which keys are required.

Create the secret in the same session, after attaching cloudquery — 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

A few rows of fixture_flaky

SELECT n FROM cloudquery.fixture.fixture_flaky LIMIT 10

Uses fixture_flaky

A few rows of fixture_item

SELECT id, name, category FROM cloudquery.fixture.fixture_item LIMIT 10

Uses fixture_item

A few rows of fixture_item_event

SELECT item_id, seq, kind
FROM cloudquery.fixture.fixture_item_event
LIMIT 10

Uses fixture_item_event

A few rows of fixture_whoami

SELECT greeting, has_token, item_count
FROM cloudquery.fixture.fixture_whoami
LIMIT 10

Uses fixture_whoami

Read a plugin table directly and aggregate it

SELECT category, count(*) AS items
FROM cloudquery.main.scan('fixture', 'fixture_item')
GROUP BY category
ORDER BY category

Uses scan

Download the CloudQuery test plugin from its GitHub release into the cache

SELECT ref, plugin_version, archive_sha256, from_cache
FROM cloudquery.main.install_plugin('github:cloudquery/[email protected]')

Uses install_plugin

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

Questions it can answer

Plain-English questions from the worker's agent test tasks. An AI agent with this catalog attached should answer each one with SQL.

  • Using the cloudquery worker, how many CloudQuery plugins are attached to the cloudquery catalog?
  • In the cloudquery catalog, which plugin table is a child relation of another table? Give the child table and its parent.
  • Which columns of the fixture plugin's fixture_item table are read as DuckDB UUID values?
  • Using the cloudquery fixture plugin, how many fixture items are there in each category?
  • In the cloudquery fixture plugin, how many restocked events belong to software items?
  • What greeting is the cloudquery fixture plugin configured with?

CloudQuery 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.