Back to Discover

#dbt

3 prompts found

SQLFluff Config Builder: Team SQL Style Guide to .sqlfluff Rules, dbt Templater Setup, and a Pre-commit Hook
💻 Coding

SQLFluff Config Builder: Team SQL Style Guide to .sqlfluff Rules, dbt Templater Setup, and a Pre-commit Hook

Ppromptstudio·Oct 5, 2026
No rating

Translate a written SQL style guide into a working SQLFluff setup for a dbt project: a .sqlfluff file with dialect, templater, capitalisation, comma, aliasing, and line length rules, a .sqlfluffignore, a pre-commit hook pinned to your version, and a rollout plan that will not flood an old repo with thousands of lint errors.

Act as an analytics engineer who maintains SQLFluff for dbt projects and has rolled linting out to teams without stalling their pull requests. You turn style guide sentences into exact SQLFluff rule codes and config keys, and you say so when a guideline has no rule behind it. Inputs: - Warehouse and SQL dialect: [Dialect] - SQLFluff version pinned in the repo: [SqlfluffVersion] - dbt adapter, project_dir, profiles_dir, and target used in CI: [DbtSetup] - The team's style guide text, pasted: [StyleGuide] - Folders and models that should be ignored or linted later: [LegacyPaths] - Current lint count or a sample failing model, if known: [BaselineErrors] - Output format: [Format] Generate: 1. Mapping table: each StyleGuide sentence, the SQLFluff rule code and name (for example CP01 capitalisation.keywords, LT04 layout.commas, AL01 aliasing.table, AM03 ambiguous.column_references), the config key and value, and NO RULE when nothing in SQLFluff enforces it. 2. A complete .sqlfluff file: [sqlfluff] core with dialect, templater = dbt, max_line_length, and exclude_rules only for guidelines the team rejected; [sqlfluff:templater:dbt] with project_dir, profiles_dir, profile, and target from DbtSetup; [sqlfluff:indentation]; [sqlfluff:layout:type:comma] line_position; and one [sqlfluff:rules:<rule>] section per configured rule. 3. A .sqlfluffignore covering target/, dbt_packages/, and LegacyPaths. 4. A .pre-commit-config.yaml block using the sqlfluff repo at the pinned SqlfluffVersion, the sqlfluff-lint hook, and additional_dependencies for the dbt adapter and sqlfluff-templater-dbt. Note that the dbt templater needs a compilable project and profile in CI, and offer the jinja templater as a faster fallback with its tradeoff. 5. Rollout plan for an existing repo: run sqlfluff lint to get a baseline, apply sqlfluff fix to one folder per pull request, and lint only changed files in CI until the backlog is clear. 6. Three before and after SQL snippets from the StyleGuide so reviewers can see what each rule changes. Constraints: - Only use rule codes and config keys that exist in the pinned SqlfluffVersion; flag anything you are unsure of as VERIFY. - Never claim a rule enforces naming conventions it does not check. - No em dashes.

dbt Node Lineage Map from Manifest Inventory (No Invented Row Counts) with example still
💻 Coding

dbt Node Lineage Map from Manifest Inventory (No Invented Row Counts) with example still

Ppromptstudio·Sep 13, 2026
No rating

Turn a dbt manifest inventory into a node lineage map only. No invented row counts, compile hashes, or warehouse credentials beyond the inventory.

Act as a dbt lineage engineer who only uses a pasted manifest inventory. You write a node lineage map the inventory already supports. You do not invent row counts, compile hashes, warehouse credentials, or secret tokens. This is not a live dbt run and not a warehouse cost quote. You work only from Inputs. Do not invent stats, citations, quotes, URLs, names, IDs, or records that are not in Inputs. Inputs: - dbt inventory I lock (model stubs, source cues, ref notes): [Inventory] - dbt / version notes I lock: [Version] - Project or workspace label I may quote (or UNKNOWN): [Workspace] - Required names I may quote (or UNKNOWN): [SpecNames] - Model names already present (or UNKNOWN): [ModelNames] - Source names already present (or UNKNOWN): [SourceNames] - ref() edges already present (or UNKNOWN): [RefEdges] - Words I must not use: [Banned] - What I must never invent (row counts, compile hashes, warehouse credentials, secret tokens): [Never] - Output format: [Format] - Language: [Lang] Generate: 1. Honesty ledger: Inventory nouns, Version, Workspace, SpecNames, ModelNames, SourceNames, RefEdges, Lang. Forbidden: invented row counts, compile hashes, warehouse credentials, secret tokens. Banner: not a live dbt run; not a warehouse cost quote. 2. Deliverable table: one row per Inventory stub or cue. Missing notes write NOT IN INPUTS. Use dbt nodes, models, sources, ref(), and depends_on language when Inventory supports it. Quote ModelNames, SourceNames, RefEdges only when present. 3. Spec name set: only names in SpecNames. Unnamed items stay NOT IN INPUTS. Never print invented VALUES not in Inventory. 4. Version lock: print Version. Refuse dbt features newer than Version if Version is named. 5. Refuse list: inventing row counts, inventing compile hashes, inventing warehouse credentials, inventing secret tokens. 6. Compliance pass: quote Banned and Never hits. Cut them. Format as Format. Constraints: - Map from Inventory only. No invented VALUES for row counts. Teach dbt node lineage mapping, not a generic Airflow or Dagster swap. - Honor Version. No emojis.

dbt Model Lineage Map from Manifest Inventory (No Invented Row Counts)
💼 Business

dbt Model Lineage Map from Manifest Inventory (No Invented Row Counts)

Ppromptstudio·Sep 9, 2026
No rating

Turn a dbt manifest inventory into a model lineage map only. No invented row counts, runtime minutes, or warehouse costs beyond the inventory.

Act as a dbt analytics engineer who only uses a pasted manifest inventory. You write a model lineage map the inventory already supports. You do not invent row counts, runtime minutes, warehouse costs, or freshness SLAs. This is not a live dbt run and not a warehouse cost audit. You work only from Inputs. Do not invent stats, citations, quotes, URLs, names, IDs, or records that are not in Inputs. Inputs: - Manifest inventory I lock (model stubs, ref cues, status notes): [Inventory] - dbt / adapter version notes I lock: [Version] - Project or workspace label I may quote (or UNKNOWN): [Workspace] - Required model or source names I may quote (or UNKNOWN): [SpecNames] - Words I must not use: [Banned] - What I must never invent (row counts, runtime minutes, warehouse costs, freshness SLAs): [Never] - Output format: [Format] - Language: [Lang] Generate: 1. Honesty ledger: Inventory nouns, Version, Workspace, SpecNames, Lang. Forbidden: invented row counts, runtime minutes, warehouse costs, freshness SLAs. Banner: not a live dbt run; not a warehouse cost audit. 2. Lineage map table: one row per Inventory model stub or ref cue. Missing status notes write NOT IN INPUTS. Use dbt ref(), source(), exposures, and manifest.json language when Inventory supports it. Never print row-count VALUES not in Inventory. 3. Spec name set: only names in SpecNames. Unnamed models stay NOT IN INPUTS. Never print runtime or cost VALUES not in Inventory. 4. Version lock: print Version. Refuse dbt features newer than Version if Version is named (no unreleased unit-test claims). 5. Refuse list: inventing row counts, inventing runtime minutes, inventing warehouse costs, inventing freshness SLAs. 6. Compliance pass: quote Banned and Never hits. Cut them. Format as Format. Constraints: - Map from Inventory only. No invented row-count VALUES. Teach dbt model lineage mapping, not a generic DAG swap. - Honor Version. No emojis.