The documentation site rewritten for Prisma 8, with the costs placed where users meet them - #1379
Draft
borisno2 wants to merge 2 commits into
Draft
The documentation site rewritten for Prisma 8, with the costs placed where users meet them#1379borisno2 wants to merge 2 commits into
borisno2 wants to merge 2 commits into
Conversation
The context-API reference now documents the two surfaces the runtime actually has: the secured surface's composed read (composers, terminals, denial values, refusals, the Where vocabulary) and write subset (args objects, identity-only `where`, `connect`/`null` relation input), with transactions and the row lock, and a bypass section that is the Unsafe surface's own recipe and cost list. `findMany`/`findUnique`/`findFirst`/`count` are gone; list keys are PascalCase. The config-API reference documents every key `DatabaseConfig` actually has — and states that `prismaClientConstructor`, `db.url` and `extendPrismaSchema` have none — plus typed referential actions, `db.timestamps`, the junction-list pattern that replaces implicit many-to-many, and `db.indexes` without the `sort` the type no longer carries. Four costs from the architecture spec's section 14 land on context-api (the to-one null check, materialisation, the two-statement row lock, aggregate's safe-integer bound) and three on config-api (application-side `updatedAt`, the unwritable required-FK cycle, hand-managed indexes losing per-field messages). Part of #1129 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
`concepts/config.md` loses the SQLite/Neon adapter recipes: postgres is the
only provider, there is no connection string in the config, and the resolution
order lives here in one sentence with the reference page as its home.
`how-to/migrate.md` replaces `prisma db push` with the `opensaas dev` loop and
`pnpm db:update`, carries cost 14 (the loop must be running; a destructive
mid-session change restarts the app), and drops `getAdminContext` for the real
`AdminUI` mount. Two access rules that returned `{ teamId: undefined }` were
fail-open bugs as well as refusals now, and are null-checked composed reads.
`how-to/migrate-from-keystone.md` replaces the whole `joinTableNaming` /
`db.relationName` section with the junction-list pattern, rewrites the access
section around the fact that `access: { filter }` does not exist, adds the
closed Where vocabulary and the write shape, and corrects
`output.prismaSchema` to `output.contractModule`.
The config-API reference gains the `{ map }` form of a relationship's
`db.foreignKey`, which is how an adopted foreign-key column is renamed.
Part of #1129
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Coverage Report for Core Package Coverage (./packages/core)
File CoverageNo changed files found. |
Contributor
Coverage Report for UI Package Coverage (./packages/ui)
File CoverageNo changed files found. |
Contributor
Coverage Report for CLI Package Coverage (./packages/cli)
File CoverageNo changed files found. |
Contributor
Coverage Report for Auth Package Coverage (./packages/auth)
File CoverageNo changed files found. |
Contributor
Coverage Report for Storage Package Coverage (./packages/storage)
File CoverageNo changed files found. |
Contributor
Coverage Report for RAG Package Coverage (./packages/rag)
File CoverageNo changed files found. |
Contributor
Coverage Report for Storage S3 Package Coverage (./packages/storage-s3)
File CoverageNo changed files found. |
Contributor
Coverage Report for Storage Vercel Package Coverage (./packages/storage-vercel)
File CoverageNo changed files found. |
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.
Implements #1174
Part of #1129
Closes #1317
Closes #1333
Draft while the remaining page groups land. Group 1 (
reference/context-api.md,reference/config-api.md) is in; groups 2–4 are in flight and will be pushed to this branch as they complete. The full costs table, per-class sweep results and per-page type-check evidence go in this body before the draft is lifted.Group 1 — the two reference pages
reference/context-api.mdis rewritten around the two surfaces the runtime actually has:.select()/.include()with refinement callbacks,aggregate((a) => ({ k: a.count() })),nearest(), materialisationAND/OR/NOT, and the fail-closed rule thatundefinedis refused rather than droppedwhere,{ connect: { id } }ornull, and the four refusal errorssudo(),withSession()findMany/findUnique/findFirst/count()are gone from the page; list keys are PascalCase throughout; the four@opensaas/stack-core/contextimports are replaced with the generated@/.opensaas/context.reference/config-api.mddocuments every keyDatabaseConfigactually carries and says plainly thatprismaClientConstructor,db.url,extendPrismaSchema,joinTableNaming,shadowDatabaseUrlanduseMigrationsdo not exist. It adds typed referential actions,db.timestamps(the user-facing spelling of what the contract module emits astemporal), the junction-list pattern that replaces implicit many-to-many, the list-leveldbkeys andisSingleton, and correctsdb.indexes—sortis gone from the type and refused at generate.OutputConfig.prismaSchemabecomescontractModule;AccessContext.prismabecomesormHandle.Costs placed so far
updatedAtis application-sidereference/config-api.mdupdatedAtis application-sidereference/context-api.mdreference/context-api.mdreference/context-api.mdreference/config-api.mdaggregate's count throws beyond ±(2^53 − 1)reference/context-api.mdaggregate's count throws beyond ±(2^53 − 1)reference/config-api.mdThe remaining seven land with groups 2–4.
Type-checking
scripts/check-doc-typescript-blocks.mjs(PR #1324) is not merged, so this uses a scratch harness: each fencedts/typescriptblock is extracted verbatim, compiled withtsc --strict --noEmitagainstpackages/*/distdeclarations, with a stand-in for the generated bundle. The harness was falsified first — a deliberately broken import and a deliberately wrong assignment both failed before any pass was trusted.reference/context-api.mdreference/config-api.mdfragment = an object-literal excerpt (
db: { … }) that is not a module. excerpt = a detached property or type sketch, the reference form. The remaining failures are harness limits, not doc bugs: two module-init recipes whose relative imports (../opensaas.config,../prisma/contract.json) resolve against the reader's own file, the Unsafe lane's structurally-typedsql/ormmembers, and three pre-existing samples on sections this group did not rewrite.Checks
pnpm --filter opensaas-stack-docs link-checkpassesgrep -rnE '\bP[0-9]{4}\b' docs/contentreturns nothinggrep -rnE 'context\.db\.[a-z]' docs/content/reference/{context,config}-api.mdreturns only prose stating the camelCase form is a compile error🤖 Generated with Claude Code