Agent Skill · Carto

carto-query-datawarehouse

Write spatial SQL against the connected warehouse — dialect-specific guidance, performance defaults, and CARTO's query/job execution model.

Provider: Carto Path in repo: skills/carto-query-datawarehouse/SKILL.md

Skill body

carto-query-datawarehouse

Run SQL — spatial or otherwise — against any connection CARTO has registered. The CLI exposes two surfaces:

Plus a sibling for usage analytics:

When to use this skill

Quick reference

# Read query (returns rows; 1-min timeout)
carto sql query <connection> "SELECT * FROM dataset.table LIMIT 10"

# Long-running job (DDL/DML; polls to completion; no rows back)
carto sql job <connection> "CREATE TABLE my_ds.out AS SELECT ..."

# From file
carto sql query <connection> --file query.sql

# Piped
echo "SELECT 1" | carto sql query <connection>
Use Command
Exploratory SELECT (small result, fast) sql query
Cached SELECT (deterministic, 1y TTL) sql query ... --cache
CREATE TABLE AS SELECT, large UPDATE sql job
5+ minute aggregation sql job (queries time out at 1 min)

--cache switches to GET with a cached response (1 year, 1 min timeout). Use only for queries that are deterministic and small enough for a URL.

What’s in this skill

Topic Reference
sql query vs sql job, caching, timeouts references/sql-jobs-and-caching.md
Spatial SQL idioms — BigQuery dialect references/spatial-sql-bigquery.md
Spatial SQL idioms — Snowflake dialect references/spatial-sql-snowflake.md
Spatial SQL idioms — Postgres / PostGIS dialect references/spatial-sql-postgres.md
Querying CARTO activity data (local DuckDB) references/activity-queries.md

Always-on guidance

Skill frontmatter

license: MIT