Skip to content

feat(transform): identityOf — canonical Postgres-native object identity - #326

Merged
pyramation merged 2 commits into
mainfrom
feat/pgpm-naming-spec
Jul 31, 2026
Merged

feat(transform): identityOf — canonical Postgres-native object identity#326
pyramation merged 2 commits into
mainfrom
feat/pgpm-naming-spec

Conversation

@pyramation

@pyramation pyramation commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

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? }; table scopes 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-qualified table.trigger names, recovers an index's table from its relation reference, reads extensions from facts.extension; null for 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 this ObjectIdentity.

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

@pyramation pyramation self-assigned this Jul 31, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot changed the title feat(transform): PGPM naming spec v1 — identityOf + pathFor (canonical derived change paths) feat(transform): identityOf — canonical Postgres-native object identity Jul 31, 2026
@pyramation
pyramation merged commit 6beda3d into main Jul 31, 2026
11 checks passed
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.

1 participant