TML-2790: M:N SQLite demo examples + project plan expansion (slices 4–6)#742
TML-2790: M:N SQLite demo examples + project plan expansion (slices 4–6)#742tensordreams wants to merge 9 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
size-limit report 📦
|
@prisma-next/extension-author-tools
@prisma-next/mongo-runtime
@prisma-next/family-mongo
@prisma-next/sql-runtime
@prisma-next/family-sql
@prisma-next/extension-arktype-json
@prisma-next/middleware-cache
@prisma-next/mongo
@prisma-next/extension-paradedb
@prisma-next/extension-pgvector
@prisma-next/extension-postgis
@prisma-next/postgres
@prisma-next/sql-orm-client
@prisma-next/sqlite
@prisma-next/extension-supabase
@prisma-next/target-mongo
@prisma-next/adapter-mongo
@prisma-next/driver-mongo
@prisma-next/contract
@prisma-next/utils
@prisma-next/config
@prisma-next/errors
@prisma-next/framework-components
@prisma-next/operations
@prisma-next/ts-render
@prisma-next/contract-authoring
@prisma-next/ids
@prisma-next/psl-parser
@prisma-next/psl-printer
@prisma-next/cli
@prisma-next/cli-telemetry
@prisma-next/emitter
@prisma-next/migration-tools
prisma-next
@prisma-next/vite-plugin-contract-emit
@prisma-next/mongo-codec
@prisma-next/mongo-contract
@prisma-next/mongo-value
@prisma-next/mongo-contract-psl
@prisma-next/mongo-contract-ts
@prisma-next/mongo-emitter
@prisma-next/mongo-schema-ir
@prisma-next/mongo-query-ast
@prisma-next/mongo-orm
@prisma-next/mongo-query-builder
@prisma-next/mongo-lowering
@prisma-next/mongo-wire
@prisma-next/sql-contract
@prisma-next/sql-errors
@prisma-next/sql-operations
@prisma-next/sql-schema-ir
@prisma-next/sql-contract-psl
@prisma-next/sql-contract-ts
@prisma-next/sql-contract-emitter
@prisma-next/sql-lane-query-builder
@prisma-next/sql-relational-core
@prisma-next/sql-builder
@prisma-next/target-postgres
@prisma-next/target-sqlite
@prisma-next/adapter-postgres
@prisma-next/adapter-sqlite
@prisma-next/driver-postgres
@prisma-next/driver-sqlite
commit: |
16dc690 to
f3a7a5c
Compare
1e62c8e to
dbaf95a
Compare
f3a7a5c to
b772b54
Compare
e19ee4a to
074d298
Compare
b772b54 to
0f9d0c2
Compare
074d298 to
ce2608d
Compare
0f9d0c2 to
2a360f4
Compare
ce2608d to
ac1c05d
Compare
2a360f4 to
67fb93c
Compare
ac1c05d to
a5f259c
Compare
9feb292 to
facaadf
Compare
a5f259c to
9829a58
Compare
facaadf to
679770d
Compare
9829a58 to
79ebfd0
Compare
Adds Tag model, PostTag junction (composite PK post_tag_pkey), and rel.manyToMany() declarations on both Post.tags and Tag.posts. Re-emits contract.json / contract.d.ts; cardinality 'N:M' + through descriptor present in the generated artifacts. Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Adds five ORM client modules exercising the Post↔Tag N:M relation:
- get-post-tags: .include('tags', ...) — include read across junction
- get-posts-by-tag-filter: .some()/.none()/.every() on N:M relation
- connect-post-tags: update + t.connect([{id}]) callback mutator
- disconnect-post-tags: update + t.disconnect([{id}]) callback mutator
- create-post-with-tags: create + t.create([...]) nested mutation
Seed extended with Tag rows + junction rows (typescript/orm/demo tags
linked to First Post and Second Post). CLI commands registered in
main.ts. Migration refs committed for offline db:init reproducibility.
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Spec + plan amended for the follow-on scope (demos + authoring completeness): slice 4 SQLite demo examples (done, TML-2790), slice 5 PSL M:N authoring (TML-2794, framework gap — may promote to its own project), slice 6 PG demo examples + dual-mode reconciliation (TML-2795, blocked by slice 5). Slice specs + provisional dispatch plans for each. Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
…N examples The new main baseline (TML-2605) trips the no-bare-cast ratchet on the string->branded-id casts in the M:N example helpers (+10). Replace the bare `as PostId`/`as TagId` casts with castAs<T> to keep lint:casts at delta 0. Behaviour unchanged (casts are erased at runtime). Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
… models (TML-2807 rebase) The post_tag and tag models added by this branch were emitted before main emitted SqlModelStorage.namespaceId (TML-2807); re-emit so the demo contract matches a fresh emit. Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
…t<->Tag through The through descriptor now carries the junction's namespaceId; re-emit the demo contract so both M:N relations declare it. Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
…r upgrade instructions The check:upgrade-coverage gate requires every PR whose diff touches examples/ to also touch the in-flight user-skill instructions. The M:N demo additions need no user-side action (additive), so no new changes[] entry — the existing array stays; this records the incidental diff. Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
0.13.0 shipped without the M:N ORM-client examples, so the user-upgrade note belongs in a new 0.13→0.14 instructions directory, not the now-released 0.12→0.13 doc. The upgrade-coverage gate targets 0.13→0.14 after the release bump. Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
679770d to
302e804
Compare
79ebfd0 to
20e4a68
Compare
Follow-on to the SQL ORM: Many-to-Many End to End project: M:N demo examples + the project-plan expansion they surfaced.
SQLite demo M:N examples (
72ef8b793,883309ecc)The SQLite demo (
examples/prisma-next-demo-sqlite, TS-authored) now demonstrates the full M:N ORM API via a purePost ↔ Tagjunction (PostTag):get-post-tags—.include(tags, t => t.select(...)).get-posts-by-tag-filter—.where(p => p.tags.some/none/every(t => t.label.eq(...))).connect-post-tags/disconnect-post-tags/create-post-with-tags—.update/.create({ tags: t => t.connect/disconnect/create([...]) })with readback.Wired as 6 CLI commands + seed; smoke-tested end-to-end (SQLite is offline-runnable); emitted contract carries
cardinality:N:M+through;emit:check+ typecheck clean.Why only SQLite (and the plan expansion) (
d711adfb6)Adding examples surfaced a real gap: the navigable M:N API is authorable only via the TS contract builder (
rel.manyToMany), not PSL — PSL emits only1:N/N:1and routes M:N to explicit junction models. The PG demo emits from PSL, so it cant show M:N until PSL learns to author it. So:Scope / notes
This PR ships the SQLite examples + the planning docs only. PG demo examples + PSL authoring are tracked (TML-2794/2795) and specd but not implemented here. No production
src/changes — demo + project-docs only.Refs: TML-2790.