LogoAwesome Skills
  • Search
  • Category
  • Tag
  • Blog
LogoAwesome Skills
LogoAwesome Skills

Discover Open-Source Agent Skills for AI Coding Assistants

Product

  • Search
  • Category
  • Tag
  • Blog

Resources

  • Claude Skill Docs
  • Antigravity Skills Docs

Tools

  • Claude Code
  • OpenCode
  • Cursor
  • Codex
  • Antigravity

Company

  • Privacy Policy
  • Terms of Service
  • Sitemap

©2026 Awesome Skills. All rights reserved.

Privacy PolicyTerms
Back to Skills

extension-querying-oql

Quick reference for the Caffeine Data Intelligence agent to query an OQL-exposing canister (schema() + execute()) through the `icp` CLI against the project's `backend` canister: read the schema, form JSON queries (filter / order / paginate / aggregate / dotted-path edges), and parse the Candid result rows.

Updated 7/9/2026
Developer Tools#oql#candid#data-intelligence#canister#query-language#icp

Security Assessment

Safe(100/100)
Security Score100/100

About extension-querying-oql

A quick-reference workflow for the Caffeine Data Intelligence agent to query an OQL-exposing canister through the pre-installed icp CLI, targeting the project's backend canister. Such a canister exposes exactly two read-only methods: schema(), which returns a JSON catalogue of the canister's entities - each entity's primary key, fields, and edges - and execute(qJson), which runs a JSON-encoded query and returns matching rows as a typed Candid Result. Both are query calls, so every invocation passes --query; the JSON query is embedded as a Candid text literal wrapped in ("...") with each quote escaped, and --branch live reads the deployed, query-only canister instead of the draft. The recommended recipe is to fetch and cache the schema once per session, map the request to the entity that holds the answer, translate it into one or more queries, run them, and retry on traps since there is no error envelope. A query is a single JSON object where only start is required, plus optional where, groupBy, aggregate, orderBy, offset, limit, and select. Predicates use exactly one operator key: eq/ne/lt/le/gt/ge for scalar relations, in for membership, contains/startsWith/endsWith and case-insensitive icontains for text, and and/or/not for boolean composition - with text search running server-side rather than paging rows into context. Scalar literals must match each field's typeName (Nat, Int, Float, Bool, or Text, with numeric bridging between the numeric types), and enum-like fields should be filtered using the exact literals listed in the schema's values array. Edges are traversed with a dotted path for forward relations, while a reverse one-to-many relationship requires fetching the parent keys first and then filtering with in.

FAQ

What two methods does an OQL canister expose?

schema() returns a JSON catalogue of the canister's entities (primary keys, fields, and edges), and execute(qJson) runs a JSON-encoded query and returns matching rows as a typed Candid Result.

How do I pass a JSON query through the icp CLI?

Embed the JSON as a Candid text literal wrapped in ("...") and escape every quote as \". Both methods are query calls, so every invocation uses --query.

How do I do a case-insensitive text search?

Use the icontains predicate, the case-insensitive form of contains. It runs server-side, so it is preferred for user-typed search terms and avoids paging rows into context.

How do I filter on an exact enum value?

Read the field's values list in the schema and filter with those exact literals - for example query "enterprise", not "Enterprise", when the schema reports lowercase arms.

How do I read the deployed canister instead of the draft?

Add --branch live to the icp call to read the deployed canister, which is query-only.

Install extension-querying-oql

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

caffeinelabs/skills

Related Skills

update-docs

1,853

amazon-seller-analytics

907

competitor-intel

705

qt-ui-design

571