No slash command · from erpl-odata
Queries OData v2/v4 services and REST/JSON APIs from DuckDB SQL using erpl_odata functions: odata_read, odata_describe, odata_attach, and HTTP methods (GET, POST, PUT, PATCH, DELETE) with auth, headers, and JSON unpacking. Handles push-down of WHERE/SELECT/LIMIT as $filter/$select/$top.
Ships in erpl-odata. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Extension: erpl_odata v2026.11.25 | DuckDB: v2.0.1 / v1.5.6
For SAP Gateway specifics (service catalog, /sap/opu/odata, ICF activation) see
erpl-odata-sap-gateway. For credentials see erpl-odata-setup.
odata_read has no secret parameter. It authenticates with the http_basic /
http_bearer secret whose SCOPE is the longest prefix of the URL. No matching secret
means an anonymous request, which usually shows up as a 401.odata_read at an entity set, ATTACH at a service root.
.../Northwind.svc/Customers is right for odata_read; .../Northwind.svc is right for
ATTACH and odata_attach.LIMIT only becomes $top when every filter was pushed down. If any predicate has
to be evaluated locally, the reader fetches every page and DuckDB filters, because a
server-side row limit over unfiltered data would return too few rows. Expect a full
scan when you use LIKE, functions on columns, or casts in WHERE.NULL by default. The scan prints one warning per
column naming the first bad value. Use strict_typing = true when a silent NULL
would corrupt downstream results.ATTACH 'https://...' (TYPE odata) needs httpfs loaded. DuckDB core sees an https
path and insists on httpfs before handing it to the OData catalog. With autoloading on
(the default) this happens by itself; air-gapped or autoload_known_extensions = false
setups need INSTALL httpfs; LOAD httpfs; first, or the attach fails with "requires
extension 'httpfs' to be loaded". odata_read does not need httpfs.ATTACH ... (TYPE odata) is read-only. It exposes every entity set as a table. There
is no INSERT / UPDATE / DELETE against OData; use http_post / http_patch for
writes.LATERAL http_get(t.url), no
recursive CTE feeding URLs back in; see "Paging through an API" for the pattern that works.http_* functions are table functions returning one row:
method, status, url, headers, content_type, content. A 4xx/5xx is a row with that
status, not an error, so check status yourself.odata_readodata_read(url VARCHAR,
top := UBIGINT, skip := UBIGINT, expand := VARCHAR, count := BOOLEAN,
max_page_size := UBIGINT, strict_typing := BOOLEAN) → TABLE
| Parameter | Effect |
|---|---|
top / skip | Fixed $top / $skip, independent of LIMIT |
expand | $expand. Navigation properties become nested STRUCT / LIST columns. Accepts nested paths such as 'Orders($expand=Order_Details)' (v4) or 'Orders/Order_Details' (v2) |
count | Requests the inline count ($inlinecount / $count) so progress can be reported |
max_page_size | Sends Prefer: odata.maxpagesize=N. Only a preference; the service may cap it. Raise it for very large extractions that hit server-side paging limits |
strict_typing | Fail on the first value that cannot be converted to its column type |
-- v2 and v4 are detected automatically
SELECT CustomerID, CompanyName, Country
FROM odata_read('https://services.odata.org/V2/Northwind/Northwind.svc/Customers')
WHERE Country = 'Germany';
SELECT UserName, FirstName, LastName
FROM odata_read('https://services.odata.org/TripPinRESTierService/People')
WHERE Gender = 'Female';
| SQL | Becomes |
|---|---|
| Selected columns | $select |
=, <>, <, <=, >, >= against constants | $filter with eq, ne, lt, le, gt, ge |
IS NULL / IS NOT NULL | eq null / ne null |
AND / OR of pushable predicates | and / or |
IN (...) | a parenthesised or chain (OData v2/v4 have no in) |
LIMIT n with no residual filter | $top=n |
Anything else (LIKE, lower(col) = ..., arithmetic on columns) is evaluated by DuckDB
after the rows arrive. To see the exact request URLs:
SET erpl_trace_enabled = true;
SET erpl_trace_level = 'DEBUG';
SELECT OrderID FROM odata_read('https://services.odata.org/V2/Northwind/Northwind.svc/Orders')
WHERE OrderDate >= '1998-01-01' AND ShipCountry IN ('Germany', 'France');
SELECT CustomerID, CompanyName, len(Orders) AS order_count
FROM odata_read('https://services.odata.org/V2/Northwind/Northwind.svc/Customers',
expand := 'Orders')
WHERE Country = 'Germany';
-- Flatten the nested orders
SELECT c.CustomerID, o.OrderID, o.OrderDate
FROM odata_read('https://services.odata.org/V2/Northwind/Northwind.svc/Customers',
expand := 'Orders') c,
UNNEST(c.Orders) AS t(o);
Nested complex types are STRUCTs too. Address their fields with dot notation, and quote names that clash with keywords:
SELECT UserName, AddressInfo[1].City."Name" AS city
FROM odata_read('https://services.odata.org/TripPinRESTierService/People');
-- Properties (DuckDB and EDM types, keys, nullability), navigation properties and
-- entity sets of the service behind one entity set URL. Accepts secret := 'name'.
SELECT * FROM odata_describe('https://services.odata.org/V2/Northwind/Northwind.svc/Customers');
ATTACH 'https://services.odata.org/V2/Northwind/Northwind.svc' AS northwind (TYPE odata);
SHOW TABLES FROM northwind;
SELECT CustomerID, CompanyName FROM northwind.Customers WHERE Country = 'Germany' LIMIT 5;
DETACH northwind;
IGNORE 'pattern' skips entity sets whose names match (for example SAP draft tables):
ATTACH 'https://host/sap/opu/odata4/sap/zsrv/srvd/sap/zsrv/0001/' AS srv (TYPE odata, IGNORE 'I_Draft*');
odata_attach(url) is the older, function-style alternative: it creates one view per
entity set in the current schema. overwrite := true replaces existing views and
ignore := ['pattern', ...] skips entity sets.
CALL odata_attach('https://services.odata.org/V2/Northwind/Northwind.svc', overwrite := true);
SELECT count(*) FROM Customers;
Prefer ATTACH: it keeps the service in its own catalog, so table names cannot collide
with local ones.
http_*http_get(url, headers := MAP, accept := VARCHAR, auth := VARCHAR, auth_type := VARCHAR,
timeout := BIGINT) → TABLE(method, status, url, headers, content_type, content)
http_head(url, ...) -- same named parameters
http_post(url, body JSON, ...) -- or http_post(url, content VARCHAR, content_type VARCHAR, ...)
http_put / http_patch / http_delete -- same two forms as http_post
| Parameter | Meaning |
|---|---|
headers | MAP(VARCHAR, VARCHAR), for example {'X-Api-Key': 'k', 'Accept-Language': 'de'} |
accept | Accept header |
content_type | Request body type |
auth | 'user:pass' for BASIC (default) or the raw token for BEARER. Overrides any secret |
auth_type | 'BASIC' or 'BEARER' |
timeout | Milliseconds |
-- GET and pick fields out of the JSON body
SELECT status, content::JSON->>'origin' AS caller_ip
FROM http_get('https://httpbin.org/get');
-- POST a JSON body built in SQL
SELECT status, content::JSON->'json' AS echoed
FROM http_post('https://httpbin.org/post', {'name': 'Alice', 'age': 30}::JSON);
-- Form-encoded body
SELECT status FROM http_post('https://httpbin.org/post', 'a=1&b=2', 'application/x-www-form-urlencoded');
-- Bearer token for a single call
SELECT status, content
FROM http_get('https://api.example.com/v1/items', auth := 'eyJhbGciOi...', auth_type := 'BEARER',
timeout := 10000);
CREATE TABLE posts AS
SELECT unnest(from_json(content::JSON,
'[{"userId":"INTEGER","id":"INTEGER","title":"VARCHAR"}]'), recursive := true)
FROM http_get('https://jsonplaceholder.typicode.com/posts');
from_json with an explicit structure is faster and more predictable than json_transform
guessing types. For large or irregular payloads, write content to a file and use
read_json instead.
The arguments of every erpl table function must be constants. A column reference, as in
LATERAL http_get(t.url) or a recursive CTE that feeds the next URL back in, fails with
"does not support lateral join column parameters". To make one call per page or per row,
generate the statements and run them, in the DuckDB CLI:
CREATE TABLE responses (page BIGINT, status INTEGER, content VARCHAR);
.mode list
.headers off
.once calls.sql
SELECT format('INSERT INTO responses SELECT {0}, status, content FROM http_get(''https://api.example.com/v1/items?page={0}'');', page)
FROM range(1, 6) t(page);
.read calls.sql
For JSON over plain GET with a known list of URLs, DuckDB's own read_json (with the
httpfs extension) also takes a list: read_json(['https://.../p1', 'https://.../p2']).
Cursor or next-link APIs need the previous response to build the next URL, so drive them
from a host language (Python, a shell loop) or run the generate-and-read step repeatedly
until no next link is left. Always bound the loop, so a misbehaving API cannot run
forever.
-- 1. Credentials scoped to the service host (skip for public services)
CREATE SECRET svc (TYPE http_basic, USERNAME 'u', PASSWORD 'p', SCOPE 'https://svc.example.com/');
-- 2. What entity sets are there?
ATTACH 'https://svc.example.com/odata/v4/catalog' AS svc (TYPE odata);
SHOW TABLES FROM svc;
-- 3. What does one look like?
SELECT * FROM odata_describe('https://svc.example.com/odata/v4/catalog/Orders');
-- 4. Sample with pushdown
SELECT * FROM svc.Orders WHERE Status = 'OPEN' LIMIT 20;
-- 5. Materialise what you need
CREATE TABLE open_orders AS
SELECT OrderID, CustomerID, Amount, CreatedAt
FROM odata_read('https://svc.example.com/odata/v4/catalog/Orders', strict_typing := true)
WHERE Status = 'OPEN';
See also: erpl-odata-setup (secrets, TLS), erpl-odata-sap-gateway (SAP-specific
discovery and quirks), erpl-odata-production (incremental loads, scheduling, tracing,
error playbook). To profile or validate what you extracted, the anofox-tabular plugin's
anofox-tabular-profiling and anofox-tabular-data-quality skills apply directly.
Reference docs:
README.md (HTTP Functions, OData v2/v4)docs/TLS.mdWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
odata, rest-api, duckdb-extension, json-parsing, api-querying
npx claudepluginhub datazoode/erpl-odata --plugin erpl-odata8 skills in this plugin
/erpl-odata-dynamics-and-delta-sharingReading Microsoft Dynamics 365 Business Central (bc_show_companies, bc_show_entities, bc_describe, bc_read with company and expand, ATTACH TYPE business_central), Dataverse / Dynamics 365 CRM (crm_show_entities, crm_describe, crm_read) and Delta Sharing shares from Databricks, SAP Business Data Cloud and other providers (delta_share_show_shares, delta_share_show_schemas, delta_share_show_tables, delta_share_scan, profile files) into DuckDB with erpl_odata. Use when the user wants ERP data from Business Central, CRM records from Dataverse, or a table shared over the Delta Sharing protocol.
/erpl-odata-microsoft-365Using Microsoft 365 as a data source and sink from DuckDB with erpl_odata's Microsoft Graph functions: Excel workbooks on OneDrive/SharePoint (graph_show_files, graph_excel_worksheets, graph_excel_tables, graph_excel_read, graph_excel_range, graph_excel_add_rows, graph_excel_delete_rows, ATTACH TYPE excel_workbook, COPY TO FORMAT graph_excel_table), SharePoint lists (graph_show_sites, graph_show_drives, graph_show_lists, graph_describe_list, graph_sharepoint_list_read, graph_sharepoint_create_item / update_item / delete_item, ATTACH TYPE sharepoint_lists with INSERT/UPDATE/DELETE, COPY TO FORMAT graph_sharepoint_list), Planner (plans, buckets, tasks, creating tasks from SQL), Outlook mail, calendars and contacts, Teams channels and messages, and Entra ID users, groups, devices and sign-in logs; app-only vs delegated permissions. Use when the user wants to read or write Excel or SharePoint data, push query results into a list or workbook, create Planner tasks from data, or report on M365 directory, mail or Teams activity.
/erpl-odata-productionRunning erpl_odata extractions unattended and operating them: job scripts for the DuckDB CLI, persistent DuckDB files or DuckLake as the landing zone, idempotent snapshot and delta (ODP) loads, scheduling with cron or systemd without overlapping runs, unattended credentials (client_credentials, secrets from environment variables, persistent secrets), run logs and monitoring, file tracing (erpl_trace_* settings, PRAGMA erpl_trace_status), and an error-to-fix playbook (401/403, TLS, 404 on /sap/opu, 202 polling, RODPS_REPL_ODP_OPEN, custom service URL guard, NULLs from type conversion). Also how to hand extracted data to other DataZoo tools: flapi to serve it as REST/MCP, anofox-tabular for data-quality gates, anofox-forecast for forecasting and anofox-visualization for dashboards. Use when the user wants to schedule or productionise an extraction, debug a failing job, or build an end-to-end pipeline from SAP or Microsoft data to an API, forecast or dashboard.
/erpl-odata-sap-datasphere-sacPulling SAP Datasphere and SAP Analytics Cloud (SAC) data into DuckDB with erpl_odata: the datasphere secret (oauth2 with authorization_code or client_credentials, config, file), discovery with datasphere_show_spaces, datasphere_show_assets, datasphere_describe_space and datasphere_describe_asset, reading relational assets with datasphere_read_relational and analytic models with datasphere_read_analytical (metrics, dimensions, params, top, skip), and SAC planning and analytic models with sac_read_planning_data, sac_read_analytical and sac_read_story_data using an access_token secret. Also covers what is not implemented yet (SAC discovery functions, ATTACH TYPE sac). Use when the user wants data from a Datasphere space or an SAC model, or asks how to log in to Datasphere from DuckDB.
/erpl-odata-sap-gatewayReading SAP S/4HANA and ECC data through SAP Gateway OData services with erpl_odata: discovering services with odata_sap_show (v2 catalog and v4 service groups), URL anatomy of /sap/opu/odata (v2) and /sap/opu/odata4 (v4 RAP services), basic-auth secrets scoped to the SAP host, describing and attaching a service, SAP-specific quirks (draft entity sets, Edm.DateTime, sap-client, mandatory filters), activating services (/IWFND/MAINT_SERVICE, /IWFND/V4_ADMIN, SICF), and the ABAP trial (A4H) sandbox. Use when the user wants data out of an SAP system via OData, cannot find or reach a Gateway service, or gets 403/404 from /sap/opu. For delta extraction use erpl-odata-sap-odp-replication instead.
/erpl-odata-sap-odp-replicationReplicating SAP data with full and delta loads through ODP (Operational Data Provisioning) OData services with erpl_odata: odp_odata_show to find ODP-enabled entity sets, odp_odata_read (secret, force_full_load, import_delta_token, max_page_size) as a change stream with ODQ_CHANGEMODE and ODQ_ENTITYCNTR, the correct DELETE + INSERT merge into a persistent DuckDB table, subscription state (odp_odata_list_subscriptions, PRAGMA odp_odata_remove_subscription), ODQMON cleanup, HTTP 202 long-running extractions, why a delta never arrives (CDS changeDataCapture vs byElement, Preference-Applied), and provisioning an ODP service headlessly with erpl-adt. Use when the user wants incremental or CDC loads from SAP extractors (0D_*, 2LIS_*), BW InfoProviders or CDS extraction views, or a delta load returns everything again.
Other plugins' skills for the same job