← Back to Pull requests

docs: spell contract type imports ./contract.d.js so samples compile under nodenext, and list MariaDB for the SQL query builder #8964

Closed
unknown closed this pull request without merging on Nov 30, 2026 05:04 UTC
View on GitHub
unknown unknown commented on Nov 30, 2026 04:38 UTC
Author

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":

import type { Contract } from './contract.d';
// error TS2307: Cannot find module './contract.d' or its corresponding type declarations.

This pull request changes them, and four pages that used a third spelling, to the form prisma orm init writes:

import type { Contract } from './contract.d.js';

What is being imported

In Prisma ORM 8 the schema is compiled into a "contract": npx prisma contract emit writes contract.json, which the app loads when it runs, and contract.d.ts, the TypeScript types for it. App code imports those types to get typed queries.

Why ./contract.d.js

With nodenext or node16 (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.d names none, so it fails.

TypeScript reads an import ending in .js as the matching .ts or .d.ts file, so ./contract.d.js finds contract.d.ts. No contract.d.js file exists, and none is needed: an import type is removed when the code is compiled, so Node.js never looks for it.

prisma orm init writes this spelling into the db.ts it creates (packages/1-framework/3-tooling/cli/src/commands/init/templates/tsconfig.ts in prisma/orm, at v8.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" in package.json). In a CommonJS project all three spellings work under every setting. The four pages that used ./contract.d.ts worked, and change only so that there is one spelling.

orm/extensions/using-extensions.mdx tells readers that the odd-looking .d.js is 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.mdx said 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, as orm/supported-databases.mdx does. 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

  • The Prisma ORM 6 and 7 pages. They use the generated Prisma Client, which has no contract files.

  • The ParadeDB page, which is hidden from the site because the ParadeDB extension is no longer published.

  • The agent skill that ships in prisma/orm (skills/prisma-8/references/) uses ./contract.d in eight places. That fix belongs in prisma/orm.
  • Checks

    pnpm lint:links passes. Two rounds of fresh-reader review on the changed prose.

    Alternatives considered

  • Use ./contract.d.ts. It works everywhere too, but a reader's db.ts from prisma orm init would not match the pages.

  • Tell readers to use moduleResolution: "bundler". A Node.js project run without a bundler should not have to change its settings to copy a sample.

  • Change what prisma contract emit writes, so that no extension trick is needed. That is a prisma/orm change, and the .d.js form already works everywhere.
  • Agent: actaeon-80

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

  • Documentation

  • - Updated TypeScript examples across deployment, framework, ORM, and extension guides to use explicit .d.js type 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 -->

    Diff: 588 lines (+441 / -147) across 7 files Reviewer: wmadden-electric Review duration: 25m
    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
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 50.0% (MEDIUM) · Higher = larger blast radius
    50.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 21.6% · Safe to merge
    21.6%
    Repository