Skip to content

0.3.0

Choose a tag to compare

@snaga snaga released this 21 Sep 06:44
· 17 commits to main since this release

AST-Digger v0.3.0 Release Notes

AST-Digger v0.3.0 introduces Snowflake SQL (.sql) data-flow and CTE (Common Table Expression) analysis via tree-sitter! 🎉
AI agents can now navigate massive Snowflake SQL transformation scripts, trace upstream CTE dependencies, extract unnamed subqueries, and detect redundant table scans with pinpoint precision and minimal token overhead.


✨ What's New

  • ❄️ Snowflake SQL AST Parsing & Data-flow DAG:
    • Added tree-sitter based SQL parser (internal/parser/sql.go) resilient to Snowflake syntax (QUALIFY, LATERAL FLATTEN, MERGE INTO, CONVERT_TIMEZONE, etc.).
    • CTE & View Extraction:
      • Extracted WITH cte AS (...), CREATE [SECURE | MATERIALIZED] VIEW, and CREATE DYNAMIC TABLE as distinct symbols.
      • Suppressed duplicate dialect syntax warnings per file.
    • Unnamed Subquery Indexing & Aliasing:
      • Supported subquery indexing (cte/subquery[0], subquery#0) and alias targeting (cte/alias) for pin-point extraction (assisting CTE refactoring).
    • Data-flow Dependency Tracking (depends_on) & Skeleton Generation:
      • Analyzed table and upstream CTE dependencies per block (depends_on: [t1, t2]).
      • Generated lightweight skeletons (-- CTE Outline) collapsing thousands of lines of query logic while preserving structural signatures.
    • Upstream Dependency Tracking (--follow-imports) & Duplicate Table Scan Search:
      • Supported topological upstream CTE extraction via --follow-imports.
      • Implemented references for SQL files to search table/CTE references and detect duplicate table scans (optimized for integration with tools like icepick).

🌐 CLI & Agent-Context Integration

  • Registered SQL (.sql) in agent-context (now supporting 8 languages and 11 file extensions).
  • Added comprehensive integration tests covering all CLI subcommands (outline, symbol, locate, references, resolve-import, agent-context) with SQL fixtures.

🧪 Quality & Verification

  • All core packages maintain >90% statement test coverage with Detroit-school unit and end-to-end integration tests.