You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
postgres extra lacks tree-sitter-sql: --postgres on a live DB silently reports 0 nodes, exit 0 #3047
Install exactly what the README prescribes for live-PostgreSQL introspection (README.md, extras table: uv tool install "graphifyy[postgres]"), then run against a real database:
Exit code 0. The database had 3 tables with FKs, a view, and a function — reproduced on postgres:17-alpine with graphifyy 0.9.48.
Why
introspect_postgres() (graphify/pg_introspect.py) reconstructs DDL and hands it to extract_sql(), which requires the tree-sitter-sql grammar. That grammar lives in the separate sql extra (pyproject.toml: sql = ["tree-sitter-sql"]) — the postgres extra ships only psycopg[binary]. When the grammar is missing, extract_sql() returns {'nodes': [], 'edges': [], 'error': 'tree_sitter_sql not installed. ...'} and introspect_postgres() returns that dict as-is; the CLI prints the node count and never looks at the error key. A live schema is indistinguishable from an empty database.
Adding tree-sitter-sql by hand makes the same command produce the full schema graph (tables/view/function nodes, FK references edges).
Suggested fix
postgres = ["psycopg[binary]", "tree-sitter-sql"] — the extra should carry what its own code path needs.
introspect_postgres() should raise when extract_sql() reports an error, reusing the CLI's existing (ConnectionError, ImportError) exit path, so the failure is loud instead of a plausible-looking empty graph.
Housekeeping: the PR for this is now #3072, not #3048.
#3048 was the same two-line fix, but I had opened it from a branch that also carried our fork's other in-flight work — 62 files and 41 commits for a change that is two lines plus a test. That was unreviewable and entirely my fault. #3072 is cut from v8 and shows 4 files, +36/-1. #3048 is closed and points here.
Nothing about the diagnosis or the fix has changed: the postgres extra is missing tree-sitter-sql, so a documented install against a live database reports 0 nodes, 0 edges and exits 0.
Confirmed on the v0.9.50 tag: the postgres extra now carries tree-sitter-sql and introspect_postgres raises instead of reporting an empty graph. Thanks for the quick turnaround.
Activity
Azeem1985 commentedon Aug 25, 2026
Housekeeping: the PR for this is now #3072, not #3048.
#3048 was the same two-line fix, but I had opened it from a branch that also carried our fork's other in-flight work — 62 files and 41 commits for a change that is two lines plus a test. That was unreviewable and entirely my fault. #3072 is cut from
v8and shows 4 files, +36/-1. #3048 is closed and points here.Nothing about the diagnosis or the fix has changed: the
postgresextra is missingtree-sitter-sql, so a documented install against a live database reports0 nodes, 0 edgesand exits 0.safishamsi commentedon Aug 25, 2026
Fixed in v0.9.50: https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.50. Closing as resolved.
Azeem1985 commentedon Aug 25, 2026
Confirmed on the v0.9.50 tag: the
postgresextra now carriestree-sitter-sqlandintrospect_postgresraises instead of reporting an empty graph. Thanks for the quick turnaround.