Add PostgreSQL semantic graph support - #1
Draft
dhritcu wants to merge 4 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
gmr/tree-sitter-postgresSQL grammar and its companion PL/pgSQL grammarsearch_path, transaction, savepoint, and temporary-relation semanticsCOPY FROM STDINpayloads without changing source offsets, and report recovered parse errorsSET search_pathLIKErelationshipsWhy
The initial SQL support could locate declarations, but a useful database graph must answer relational questions without inventing dependencies. Looking up a table should expose its foreign-key neighbors, triggers, routines, and migration history. PostgreSQL naming, local
search_path, psql input, repeated historical definitions, drops, re-creations, and renames all need ordered handling for those trails to stay accurate.Validation
npm run buildGIT_CONFIG_GLOBAL=/dev/null npm testdevelopmentindex using/private/tmp/codegraph-source/dist/bin/codegraph.jsfrom this branch:public.usersexposes its FK neighbors, 6 triggers, routine/view/index references, and constraint namespublic.tagskeeps itspublic.appsFK undertags_app_slug_fkeyand its incomingpublic.tag_assignmentsFKIntentional limits
EXECUTEis skipped; only statically identifiable routine-body SQL is linkedpg_cataloglookup and external Supabase/auth/storage objects can remain unresolved