coral

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Coral CLI Skill

Coral CLI Skill

Use this skill to answer data questions by querying connected sources with
coral sql
.
使用该Skill通过
coral sql
查询已连接的数据源来解答数据相关问题。

Discovery-First Workflow

探索优先工作流

Before writing any query, follow these steps:
  1. List available tables:
sql
SELECT schema_name, table_name, description, required_filters, guide FROM coral.tables;
  1. Read the
    guide
    column
    — it contains per-table query patterns and gotchas. Use it.
  2. Check required filters for the table you want to query. Queries against tables with required filters will fail without the corresponding WHERE clauses.
sql
SELECT column_name, data_type, is_required_filter, is_virtual, description
FROM coral.columns
WHERE schema_name = '<source>' AND table_name = '<table>'
ORDER BY ordinal_position;
  1. Inspect source inputs when config affects the query or answer. This matters when you need source-specific values such as Datadog's
    DD_SITE
    or Sentry's
    SENTRY_ORG
    to build absolute links, explain account scope, or debug missing configuration.
sql
SELECT key, kind, value, default_value, hint, required, is_set
FROM coral.inputs
WHERE schema_name = '<source>'
ORDER BY key;
  1. Then query:
bash
coral sql "SELECT <columns> FROM <source>.<table> WHERE <required_filters> LIMIT 10"
在编写任何查询之前,请遵循以下步骤:
  1. 列出可用表:
sql
SELECT schema_name, table_name, description, required_filters, guide FROM coral.tables;
  1. 阅读
    guide
    — 其中包含每个表的查询模式和注意事项,请务必使用。
  2. 检查目标表的必填过滤器。如果查询带有必填过滤器的表时未添加对应的WHERE子句,查询将失败。
sql
SELECT column_name, data_type, is_required_filter, is_virtual, description
FROM coral.columns
WHERE schema_name = '<source>' AND table_name = '<table>'
ORDER BY ordinal_position;
  1. 当配置影响查询或结果时,检查源输入。当你需要特定于数据源的值(如Datadog的
    DD_SITE
    或Sentry的
    SENTRY_ORG
    )来构建绝对链接、解释账户范围或调试缺失配置时,这一点至关重要。
sql
SELECT key, kind, value, default_value, hint, required, is_set
FROM coral.inputs
WHERE schema_name = '<source>'
ORDER BY key;
  1. 然后执行查询:
bash
coral sql "SELECT <columns> FROM <source>.<table> WHERE <required_filters> LIMIT 10"

Query Guidance

查询指南

  • Virtual columns: Filter-only columns accepted in WHERE clauses but returning NULL in results. Check
    is_virtual
    in
    coral.columns
    .
  • coral.inputs
    :
    Use it to inspect per-source variables and secrets before making assumptions about URLs, org names, regions, or other source config. Secret rows always return
    value = NULL
    ; use
    is_set
    to confirm whether a secret is configured.
  • Cross-source joins: Standard SQL JOINs work across source schemas. Cross-source joins execute in memory after source scans complete.
  • 虚拟列: 仅可在WHERE子句中用于过滤,但在结果中返回NULL的列。请查看
    coral.columns
    中的
    is_virtual
    字段。
  • coral.inputs
    在假设URL、组织名称、区域或其他源配置之前,使用它检查每个数据源的变量和密钥。密钥行始终返回
    value = NULL
    ;请使用
    is_set
    确认密钥是否已配置。
  • 跨源连接: 标准SQL JOIN可跨源模式使用。跨源连接会在源扫描完成后在内存中执行。