Skip to content

Public API docblocks still describe emission in Prisma schema-language terms #1413

Description

@borisno2

The problem

The Prisma 8 build deleted schema-language generation: the generator emits a TypeScript Contract module and Prisma emits contract.json / contract.d.ts from it (ADR-0040). Roughly 51 TSDoc comments across 16 source files still describe what a config option does in terms of the schema language it no longer produces.

The heaviest concentrations:

File Count
packages/core/src/config/types.ts 17
packages/auth/src/config/types.ts 12
packages/storage/src/utils/multi-column.ts 3
packages/auth/src/config/derive-auth-lists.ts 2
packages/auth/src/server/index.ts 2

Representative examples, all on exported config options:

  • ListConfig.db.map — "Adds a @@map attribute to the generated Prisma model. … // Generates: model AuthUser { ... @@map("user") }"
  • ListConfig.db.schema — "Adds a @@schema attribute to the generated Prisma model", requiring "the multiSchema preview feature". The contract carries a namespace; there is no preview feature.
  • DatabaseConfig.schemas — "the generator enables Prisma's multiSchema preview feature and emits the schemas = [...] array on the datasource block"
  • ListConfig.db.indexes// Generates: @@unique([studentId, productionId])
  • OutputConfig — "prisma/schema.prisma and the .opensaas bundle to .opensaas/"

Why it matters more than an ordinary stale comment

The repo's own comment rule makes public API docblocks the deliberate exception to "default to none", precisely because they are what a consumer's editor shows — "that is a contract, not a narration of the implementation beneath it." A reader hovering db.schema today is told to expect an attribute in a file the generator does not write.

It is also the class of defect that surface-diffing cannot catch: the option is real, the name is right, and only the described effect is wrong. Same shape as #1389, which is one instance of it (db.indexes and sort).

What to do

Rewrite the affected docblocks against what the contract actually carries — namespace, table map, column map, unique constraint, index — and drop the // Generates: lines that quote schema-language output, or replace them with the contract shape. Take the code as the truth; packages/core/src/contract/derive.ts is where each option lands.

Needs a changeset (minor, per the integration branch's policy on #1175).

Worth doing as one sweep rather than per option, and worth a mechanical check afterwards — @@map, @@schema, @@unique, @@index, schema.prisma, multiSchema, previewFeatures — scoped to packages/*/src and excluding the migration command, whose job is reading a source project's Prisma schema and which is legitimately out of scope (spec section 15).

Context


🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Prisma8Relates to the Prisma 8 migration (prisma-8 branch)bugSomething isn't workingpriority:mediumShould land before or shortly after release; has a workaround or narrow blast radiusready-for-agentFully specified, ready for an AFK agent

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions