TML-2790: M:N SQLite demo examples + project plan expansion (slices 4–6)#697
TML-2790: M:N SQLite demo examples + project plan expansion (slices 4–6)#697tensordreams wants to merge 4 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/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: |
d711adf to
5ad3cff
Compare
3e1c908 to
308b48d
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>
bd25a3c to
c1c88d2
Compare
308b48d to
bb3e246
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.