feat(transform): identityOf — canonical Postgres-native object identity - #326
Merged
Conversation
…l derived change paths)
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…rendering downstream
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.
Summary
Adds the object-identity layer to
@pgsql/transform— the canonical answer to "what object is this statement about?", derived purely from classifier facts and the parser's node taxonomy (CreateStmt,CreateTrigStmt,IndexStmt, ...), never from surface syntax like RangeVars.ObjectIdentity—{ kind, schema, name, table? };tablescopes objects only unique per table (triggers, policies, indexes, constraints, seed data). This tuple is the key for dependency graphs, semantic diffing, and downstream naming.identityOf(facts: StatementFacts): ObjectIdentity | null— splits the classifier's table-qualifiedtable.triggernames, recovers an index's table from its relation reference, reads extensions fromfacts.extension;nullfor grants/comments (they ride with the object they attach to).Deliberately no path rendering here: change paths (e.g. pgpm module layouts) are derived projections owned by the packaging layer that consumes the identity — this package stays pgpm-agnostic. The pgpm naming spec (
pathFor) lands separately in the constructive monorepo, keyed on thisObjectIdentity.Reservations documented: function-overload signature disambiguation; constraint own-names (facts currently carry only the target table).
Link to Devin session: https://app.devin.ai/sessions/562099f8b3d94877b5ab57ec8bb90bec
Requested by: @pyramation