Skip to content

SQL: tree-sitter-sql 0.3.13 drops writes from parsed T-SQL procedures #5146

Closed

Description

@sub4biz

Summary

On clean graphify v0.9.106 with tree-sitter-sql 0.3.13, a DELETE inside a T-SQL procedure produces no writes_to edge. With tree-sitter-sql 0.3.11 the edge is present. The dependency is unpinned in the sql extra.

Reproduction

Install the dependencies from a clean v0.9.106 checkout with python -m pip install ".[sql]" "tree-sitter-sql==0.3.13", then run:

from pathlib import Path
from tempfile import TemporaryDirectory
from graphify.extract import extract_sql
with TemporaryDirectory() as tmp:
    path = Path(tmp) / 'demo.sql'
    path.write_text('CREATE PROCEDURE dbo.D AS\nBEGIN\n DELETE FROM dbo.Payments WHERE Amount = 0\nEND\nGO\n', encoding='utf-8')
    graph = extract_sql(path)
    nodes = {n['id']: n['label'] for n in graph['nodes']}
    print(sorted((nodes[e['source']], e['relation'], nodes[e['target']]) for e in graph['edges'] if e['relation'] != 'contains'))

Observed: []. Expected: [('dbo.D()', 'writes_to', 'dbo.Payments')].

Related

#4635 covers writes from T-SQL procedures. The newer grammar parses this procedure structurally, so it no longer takes the recovery path.

Activity

  1. github-actions commented on Nov 11, 2026

    @github-actions

    Thanks for opening this issue, @sub4biz. A maintainer will take a look soon.

    If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.

    To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.

  2. safishamsi commented on Nov 15, 2026

    @safishamsi
    Member

    Fixed by #5211 (e477379), released in graphify 0.9.110. Thanks @sub4biz for the report and @sunhouy for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions