Repository navigation
docs(orm8): plain-language pass on the ORM client reference - #8260
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. WalkthroughThe ChangesORM documentation link
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~2 minutes Change: Other Merge Risk: ⚪ Minimal · up to The updated cross-reference points to the intended documentation section, so the change is ready to merge. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🍈 Lychee Link Check Report87 links: ✅ All links are working!Full Statistics Table
|
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
…verified: fixer agents were stopped before reporting) The four fixer agents finished writing their slices but were stopped before they reported their source lookups. The fact re-check has not run. Reader reports, the page rules, and the shared conventions are committed under docs/orm-docs-audit/c21-orm-client/ for the next agent. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
…rc.9 Four checkers read every claim in the page against prisma/orm at 8.0.0-rc.9 (f889eeb89e). Corrections: the page no longer claims its examples are copied from a test suite (no fixture in the tree has this schema); TypeScript refuses all six update and delete methods without where() on PostgreSQL; the multi-table variant messages name Bug on Task; MongoDB update input covers base-model fields only, and the upsert _id comes back as a hex string; MongoFieldFilter.of passes any operator through, so regex and elemMatch are reachable; a misspelled field operation is a compile error; the four array operations are tested; aggregates outside include() throw ORM.INCLUDE_INVALID; min and max are also null over an empty set; shorthand null on MongoDB also matches a missing field; ORM.FILTER_UNSUPPORTED is PostgreSQL only; sum and avg accept Time, not timetz; Temporal note now gives the polyfill import; cursor() throws ORM.CURSOR_VALUE_MISSING. Reports are in docs/orm-docs-audit/c21-orm-client/factcheck1.part*.md, to be removed before merge. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Four fresh readers, four fixers, one per slice. Wording only, facts unchanged, except where a reader's question had a verified answer: where() before upsert() on PostgreSQL is ignored, ORM.WHERE_MISSING on every MongoDB write, and() and or() take any number of conditions, having() can be chained, GroupedCollection cannot be awaited, MongoAndExpr.of, isRuntimeError, db.close(). Page length unchanged (2,056 lines). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Wording round with a no-growth budget (2,056 to 2,049 lines). Answers readers asked for, each looked up in rc.9: native_enum syntax shown, the @@base discriminator value, the many-to-many rule as an instruction, counting on MongoDB with db.query, firstOrThrow(), conflictOn on several columns, ORM.WHERE_MISSING includes upsert(), is/isNot mapped onto some()/none(), Json has no equality comparison so the shorthand object throws ORM.FILTER_UNSUPPORTED, precise-number aggregates shown, sorting groups by an aggregate via db.sql. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Last wording round. Readers tripped on round three's additions, so this round cut them back: the db.sql example under groupBy() is gone in favour of the link, the Decimal and BigInt aggregate rules are one table, and the comparison-method rules are one line per rule with the field types named. Facts looked up for the marks: firstOrThrow() reads every matching row, createAll() inserts before yielding, aggregate() honours an earlier limit(), every() on a to-one relation also matches a missing row, where({}) still throws ORM.WHERE_MISSING, a second for await throws RUNTIME.ITERATOR_CONSUMED. 2,049 to 2,048 lines.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
Four checkers re-read every claim after the wording rounds. Thirteen corrections: a PostgreSQL DateTime filter takes a Temporal.Instant, not a Date; isRuntimeError is false for ORM.* errors, so catch blocks compare error.code; create() and connect() take an object or an array on any relation; prisma db update replaces prisma migrate dev; db.raw is raw queries, not SQL, on MongoDB; sum() and avg() accept an interval; ORM.CURSOR_VALUE_MISSING is thrown when the query runs; count() can throw out of range; countBigInt() also takes a field; the grouped chain order is having/orderBy then limit/offset; an example result made self-consistent; count maps to aggregate() on PostgreSQL only; the embedded-object set() needs every field. Two verified omissions added: MongoDB updateAndCount() excludes documents already holding the new values, and MongoDB writes reject orderBy/limit/offset and include() on the chain with ORM.OPERATION_UNSUPPORTED. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
The reader reports, checker reports, and conventions files stay in this branch's history at d104536 for anyone reviewing the pass; they are not part of the docs. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
…pes section through the rewrite #8261 added "Model and result types" to the old page. Rebased onto main and rewrote that section against this page's schema and wording: the page's own contract import, the example User's fields, no SQLite, and the rc.10 note that a contract emitted earlier has no Models until you emit again. Facts unchanged from the rc.10 release notes and shape.ts. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
e263074 to
f6f037f
Compare
…age has The link added in #8262 named #named-model-types; the heading's anchor is #model-and-result-types, so the docs link check fails on main. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
Before, the MongoDB setup paragraph on the ORM client reference read:
After:
Same fact, no "root names", no "roots map", no "facet".
The decision
This PR is the plain-language pass (C21) on
orm/reference/orm-client.mdx, the same treatment the five fundamentals pages got in #8251. The page keeps its reference layout (Remarks, Options, Return type, Examples, PostgreSQL and MongoDB tabs) and every heading and anchor. What changed is the wording, the order of ideas, and the examples, plus the corrections the fact checks found.Two decisions a reviewer should know about:
push/pullrun against a live MongoDB inorm-ergonomics.test.ts.What the fact checks corrected
The round-one fixes from the previous session were unverified, so this PR started with a full fact re-check against prisma/orm at
8.0.0-rc.9(f889eeb89e), and ended with another after the wording rounds. Corrections that changed what the page says:where()on PostgreSQL, not justupdate()anddelete(). On MongoDB the check is at run time, codeORM.WHERE_MISSING, and coversupsert()too.BugonTask, so theORM.OPERATION_UNSUPPORTEDmessages name those.// @ts-expect-error. The MongoDBupsert()returns_idas a hex string, not anObjectId.MongoFieldFilter.ofpasses any operator through, so$regex,$elemMatch, and$sizeare reachable; the page had said the library has no regex support anywhere.undefinedat run time.include()throwORM.INCLUDE_INVALID.min()andmax()are alsonullover an empty set.sum()andavg()accept aTimecolumn, not an interval.avg()over an integer returns a floating-pointnumber, not a rounded one.nullon MongoDB also matches a missing field.ORM.FILTER_UNSUPPORTEDis PostgreSQL only, and the field type that triggers it isJson, not a vector.cursor()throwsORM.CURSOR_VALUE_MISSINGwhen the cursor object leaves out a sort column.firstOrThrow()reads every matching row before returning the first.The final re-check, after four wording rounds, found thirteen more drifts and fixed them. The ones a reader would have hit: a PostgreSQL
DateTimefilter takes aTemporal.Instant, not aDate(the example passed aDate);isRuntimeErroris false forORM.*errors, so the page no longer pointscatchblocks at it for those;create()andconnect()take an object or an array on any relation; the grouped chain needsorderBy()beforelimit(), which the types enforce; setting an embedded object withset()needs every field.After #8261 merged
Rebased onto main. #8261 had added a "Model and result types" section to the old page, so it is rewritten here against this page's schema and wording, with the same facts from the rc.10 release notes and
shape.ts: the page's own./contract.dimport, the exampleUser's fields, no SQLite, and the note that a contract emitted before rc.10 has noModelsuntil you runcontract emitagain. One extra commit fixes a link on the SQL query builder page that #8262 pointed at#named-model-types; the heading's anchor is#model-and-result-types, and the docs link check fails on main because of it.How it was checked
.claude/skills/docs-reader-review/references/reader-persona.md, then a fixer per slice with the shared and page conventions and the rc.9 source. Round three and four ran with a "no longer than now" budget; the page went from 2,058 to 2,048 lines.check-plain.sh,cspell, and the docs link check pass on the final page.What a reviewer should know
changes.md, out of scope here.Alternatives considered
int4ids, no enums, and noTask/Bug, so every example on the page and on the fundamentals pages would change.🤖 Generated with Claude Code
Summary by CodeRabbit