Skip to content

fix: add tree-sitter-sql to base dependencies#1494

Open
GAURAV-1313 wants to merge 1 commit into
Graphify-Labs:v8from
GAURAV-1313:feat/sql-ast-extraction
Open

fix: add tree-sitter-sql to base dependencies#1494
GAURAV-1313 wants to merge 1 commit into
Graphify-Labs:v8from
GAURAV-1313:feat/sql-ast-extraction

Conversation

@GAURAV-1313

Copy link
Copy Markdown

Adds tree-sitter-sql to base dependencies so .sql files are extracted via AST.

What it extracts

Tables (CREATE TABLE), views (CREATE VIEW), functions (CREATE FUNCTION), column definitions, primary keys, foreign keys (REFERENCES), ALTER TABLE ... ADD FOREIGN KEY, and schema-qualified names (Sales.Customer).

Edges emitted

Relation From To
contains file table/view/function
references table referenced table (FK REFERENCES)
reads_from function tables read by SELECT

Changes

  • pyproject.tomltree-sitter-sql>=0.3,<0.4 added to base dependencies
  • uv.lock — updated with tree-sitter-sql==0.3.11

Before

SQL files were classified as code (.sql was already in CODE_EXTENSIONS) and extract_sql() was registered in the dispatch table (line 12790), but tree-sitter-sql was only in the [sql] optional extra. Default installs (uv tool install graphifyy) had 0 nodes extracted from .sql files — they were invisible to the graph.

After

tree-sitter-sql is installed by default. All 9 SQL tests pass. Full test suite (2440 tests) has no regressions.

Closes #1383

SQL files are classified as code (CODE_EXTENSIONS) and extract_sql()
is registered in the dispatch table, but tree-sitter-sql was only in
the [sql] optional extra. This meant .sql files extracted 0 nodes
for default installs — they were invisible to the graph.

tree-sitter-sql is a small, stable C extension (~341KB). extract_sql()
already has an ImportError guard. All 9 SQL tests pass. Full test
suite (2440 tests) has no regressions.

Closes Graphify-Labs#1383
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extraction Strategy for SQL Files — When AST vs LLM is Used

1 participant