effective-dbt-sql
仓库创建 2021年3月19日最近提交 1 天前SkillHot 收录 1 天前
▸ 精选理由
帮助数据工程师写出更可维护、重用性高且性能友好的模型 SQL。
这个 Skill 做什么
对 dbt 模型 SQL 提供语义正确性与重构优先级的实践规则。
给 dbt 模型的 SQL 提供实用规则:什么时候复用已有字段、什么时候写子查询或重构为可复用的 dimension/metric,优先用 CTEs 而不是相关子查询,并要求显式的 join 和列清单。用在编写或修改 dbt 模型、重构指标或决定查询结构时。特点是把语义正确性和可维护性放在第一位,降低重复和意外破坏。
6.0k
Stars
750
Forks
21
仓库内 Skill
+0
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/lightdash/lightdash/main/skills/effective-dbt-sql/SKILL.md或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/lightdash/lightdash/main/skills/effective-dbt-sql/SKILL.md"SKILL.MD 节选查看完整文件 ↗
--- name: effective-dbt-sql description: Use when writing or modifying dbt model SQL — deciding whether to add a subquery or reuse an existing dimension/metric, structuring a query, joining models, or refactoring a metric's SQL. Encodes SQL semantic-correctness rules: reuse existing fields, prefer CTEs over correlated subqueries, and make joins and column lists explicit. --- # Effective dbt SQL Write dbt model SQL that is correct, readable, and idiomatic. This skill is about the **semantics** of the SQL you write — not naming or formatting. ## Scope **Use this when** you are about to write or change SQL inside a dbt model (`.sql`), or a metric/dimension whose value is defined by SQL. **
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有