docs: M:N ORM methods, composite PKs, expose_in_api, filter type-safety#69
Merged
pyramation merged 2 commits intomainfrom Mar 21, 2026
Merged
Conversation
…i, filter type-safety
🤖 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:
|
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
Updates four skill reference files to document the v5 M:N ORM support implemented across PRs #863, #867, #869, #879, #880 in the main constructive repo.
Files changed:
codegen-relations.md— Major rewrite. Adds sections on: how M:N junction tables work,expose_in_apionrelation_provision,add<Relation>()/remove<Relation>()generated methods, junction table CRUD, composite PK detection/naming/deletion, PK type safety, codegen pipeline architecture, filter type safety from schema, and a full M:N lifecycle walkthrough. Preserves existing "Posts with Comment Count", "User Feed with Mixed Content", and other pattern examples.codegen-orm-output.md— Adds M:N convenience methods section (addTag/removeTag), junction table model entry, composite PK delete example.query-meta-introspection.md— AddsjunctionLeftKeyFieldsandjunctionRightKeyFieldsto the example_metaquery and response type comment.SKILL.md— Updates the reference table entry forcodegen-relations.mdto reflect broader scope.Updates since last revision
codegen-relations.md. These now coexist alongside the new M:N lifecycle example.Review & Testing Checklist for Human
addTag(postId, tagId),removeTag(postId, tagId), and composite PKdelete({ where: { postId, tagId } })signatures should be cross-referenced against the generated output from PR #880. These were written from context, not copied from generated code.expose_in_apidescription — Confirm the flag is onrelation_provision, defaults totrue, and syncs tosmart_tagsvia triggers (as implemented in constructive-db PR #642)._metafield names — ConfirmjunctionLeftKeyFieldsandjunctionRightKeyFieldsare the actual field names exposed by the_metaendpoint (fromenrich-relations.ts).Notes
codegen-orm-output.mdwere changed from unicode (├── └──) to ASCII (|- '-). This is a minor formatting regression that may want correcting.Link to Devin session: https://app.devin.ai/sessions/745d2d10b699452091e24131ba5edef2
Requested by: @pyramation