Repository navigation
Conversation
Nine tool stubs exposed through `altimate tool run` (dbt_run_results, dbt_defer_state, dbt_map_relations, docs_share_comments, dbt_cost_estimate, dbt_health, dbt_sql_graph, dbt_docs_coverage, dbt_cte_profile), an exported `AltimateApi.apiRequest` that calls the backend with the stored credentials, and `dbtAdapterFor`, the one gate every adapter-backed tool goes through: it refuses read-only calls, other projects, and an adapter that did not start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Compiles the model, reads its parents' columns from the warehouse's metadata, and asks the Altimate backend's sql_lineage endpoint; the graph's final select is named after the model and its relations are tied to their dbt nodes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…fore compile, model-name collisions, models only Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
|
Review of this change (two independent reviewers, then a separate check of the fixes). Each finding and what happened to it, fixed in f6aed61: Fixed
Not changed, on purpose
Cost side effects are unchanged: one backend call and one warehouse metadata read per call. |
|
👋 This PR was automatically closed by our quality checks. Common reasons:
If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. |
Issue for this PR
None
Type of change
What does this PR do?
Adds the
dbt_sql_graph { model }tool. It compiles the model with the project's dbt integration, reads its non-ephemeral parents' columns from the warehouse's metadata, and sends the compiled SQL to the Altimate backend'sdbt/v3/sql_lineageendpoint (api/sql-lineage.ts). The backend's__final_select__is renamed after the model and each relation node is tied to its dbt unique id, as Power User does. The result is{ nodes: [{ name, type, nodeId?, sql, columns }], edges: [[from, to]] }plus a one-line-per-node text list. It is adapter-backed, so it needs write permission and an Altimate key; read-only calls get the foundation's refusal.This branch contains the Power User foundation commits (
feat/pu-mods-foundation); this PR's own change istools/dbt-sql-graph.ts,api/sql-lineage.tsandtest/altimate/dbt-sql-graph.test.ts.How did you verify your code works?
bun test test/altimate/dbt-sql-graph.test.ts(11 tests, mocked endpoint and adapter: the remap, source and model parents, column merge, failures, abort) andbun typecheck, both frompackages/opencode.Cost side effects
One backend call and one warehouse metadata read (
getBulkSchemaFromDB, parents only) perdbt_sql_graphcall. Nothing runs per edit. The model's compile can run SQL only as the dbt integration already does for any compile.Screenshots / recordings
Demo video to follow.
Checklist
Changelog:
dbt_sql_graphtool: a dbt model's CTEs, joins and filters as a graph.🤖 Generated with Claude Code
Summary by cubic
Adds the
dbt_sql_graph { model }tool, which compiles a model with the dbt adapter and returns its CTEs, joins, and filters as a graph of nodes and edges, and lays the shared foundation for adapter-backed Altimate tools.dbt/v3/sql_lineageendpoint, names the final select after the model (<model> (final select)when the SQL already has a node by that name), and ties each relation to its dbt unique id.dbtAdapterForis the single gate for adapter-backed tools: it refuses read-only calls, sessions in a different dbt project, and an adapter that didn't start, with a bounded wait that follows call aborts.AltimateApi.apiRequestposts to any backend endpoint with the stored credentials and a clear error naming the credentials file when missing.dbt_run_results,dbt_defer_state,dbt_map_relations,docs_share_comments,dbt_cost_estimate,dbt_health,dbt_docs_coverage,dbt_cte_profile) are exposed through the tool allow-list as not-yet-implemented placeholders.Written for commit f6aed61. Summary will update on new commits.