Skip to content

Should tree-sitter-sql be a core dependency? Default installs still extract 0 nodes from .sql (follow-up to #1745, #3047) #3165

Open

Description

@egarcia74

Where things stand

#1745 fixed the silence: since 0.9.12 a default install prints a warning naming pip install "graphifyy[sql]" when .sql files are skipped. #3047/#3072 (v0.9.50) fixed the same gap for the postgres extra, which now carries the grammar.

What is still true on 0.9.51: uv tool install graphifyy / pipx install graphifyy — the commands the README leads with — produce a graph with an entire language missing for any corpus that contains SQL, and the fix requires the operator to notice a warning and re-install with an extra. We hit this in the field on a 391-file T-SQL corpus (zero SQL object nodes on a fresh default install).

The question

Is there a reason tree-sitter-sql stays optional that I'm missing? The packaging comments in pyproject.toml give the criteria for optional grammars, and SQL seems to fail all of them:

  • Toolchain risk (the reason tree-sitter-dm is optional, Unable to install with uv tool install graphifyy #1104): does not apply — tree-sitter-sql ships prebuilt abi3 wheels for every supported platform (Windows/macOS/Linux glibc+musl, x86_64+arm64) from 0.3.9, so a core pin keeps the default install toolchain-free.
  • Niche language (the reason tree-sitter-commonlisp is optional): SQL is not niche — schemas, migrations and stored procedures show up in most application repos.
  • A regex fallback exists (the reason tree-sitter-pascal is optional, feat(extract): add Pascal/Delphi and Lazarus IDE support #781): there is no fallback for SQL; absence means zero nodes.

Proposal

Promote tree-sitter-sql>=0.3.9,<0.4 to [project.dependencies] (upper bound like every other grammar pin), keep sql and the postgres entry as no-op aliases so existing install commands keep resolving, drop .sql from _EXTRA_FOR_EXTENSION so the #1745 warning no longer points at a redundant extra, and add a packaging-layer test so the dependency cannot slide back into an extra unnoticed.

A PR implementing exactly that is ready (rebased on current v8, lock regenerated, full suite green). If the answer is "no, extras are the policy", that's fine too — the fallback would be to make the README's leading install command graphifyy[sql], or to have the #1745 warning fail the run rather than warn, so the missing language is not something an operator can scroll past.

Activity

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