docs: spell contract type imports ./contract.d.js so samples compile under nodenext, and list MariaDB for the SQL query builder #8964
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.50) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 588 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.382
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #8964"
general
weight: 0.35
wmadden-electric
On 21 Prisma ORM 8 pages, a code sample imports the app's generated schema types in a form that TypeScript rejects in a project set to
moduleResolution: "nodenext":This pull request changes them, and four pages that used a third spelling, to the form
prisma orm initwrites:What is being imported
In Prisma ORM 8 the schema is compiled into a "contract":
npx prisma contract emitwritescontract.json, which the app loads when it runs, andcontract.d.ts, the TypeScript types for it. App code imports those types to get typed queries.Why
./contract.d.jsWith
nodenextornode16(the settings for a project that Node.js runs directly as ES modules), TypeScript requires a relative import to name its file extension, as Node.js does../contract.dnames none, so it fails.TypeScript reads an import ending in
.jsas the matching.tsor.d.tsfile, so./contract.d.jsfindscontract.d.ts. Nocontract.d.jsfile exists, and none is needed: animport typeis removed when the code is compiled, so Node.js never looks for it.prisma orm initwrites this spelling into thedb.tsit creates (packages/1-framework/3-tooling/cli/src/commands/init/templates/tsconfig.tsin prisma/orm, atv8.0.0-rc.25), and 18 pages already used it. So a reader's own project and every page now match.I type-checked the three spellings with TypeScript 5.9:
| Import |
nodenext|node16|node10|bundler|| --- | --- | --- | --- | --- |
|
./contract.d| fails, TS2307 | fails, TS2307 | works | works ||
./contract.d.js| works | works | works | works ||
./contract.d.ts| works | works | works | works |The table is for an ES module project (
"type": "module"inpackage.json). In a CommonJS project all three spellings work under every setting. The four pages that used./contract.d.tsworked, and change only so that there is one spelling.orm/extensions/using-extensions.mdxtells readers that the odd-looking.d.jsis not a typo, so nobody "corrects" it. That sentence now names./contract.d.js, and says why nothing is loaded at run time.Four reference and guide pages also told readers in prose to write
./contract.d; they now say./contract.d.js. So do the "Create the client" snippets on the extension pages of prisma.io/extensions (apps/site/src/components/extensions/usage-snippets.ts).Also in this pull request: MariaDB and the SQL query builder
orm/fundamentals/advanced-queries.mdxsaid the SQL query builder works on PostgreSQL, SQLite and MySQL, with only MySQL marked Early Access. It now lists MariaDB too, whose library runs the SQL builder, and marks SQLite, MySQL and MariaDB as Early Access, asorm/supported-databases.mdxdoes. The same paragraph said raw SQL values are "sent as parameters", which is not true on MySQL and MariaDB, where the driver escapes values into the statement. It now says so and points to the rules for raw SQL there.Not changed
skills/prisma-8/references/) uses./contract.din eight places. That fix belongs in prisma/orm.Checks
pnpm lint:linkspasses. Two rounds of fresh-reader review on the changed prose.Alternatives considered
./contract.d.ts. It works everywhere too, but a reader'sdb.tsfromprisma orm initwould not match the pages.moduleResolution: "bundler". A Node.js project run without a bundler should not have to change its settings to copy a sample.prisma contract emitwrites, so that no extension trick is needed. That is a prisma/orm change, and the.d.jsform already works everywhere.Agent: actaeon-80
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
- Updated TypeScript examples across deployment, framework, ORM, and extension guides to use explicit
.d.jstype import paths for broader module-resolution compatibility.- Clarified SQL-builder database support and Early Access status, and updated guidance on raw SQL value handling.
- Added notes on type-only imports and a CommonJS alternative for JSON imports.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->