Skip to content

TML-3607: Type aliases can set @onCreate and @onUpdate, and the contract stores the real column type instead of the alias name - #30819

Merged
wmadden merged 38 commits into
mainfrom
tml-3607-alias-expansion
Oct 22, 2026
Merged

wmadden merged 38 commits into
mainfrom
tml-3607-alias-expansion

Conversation

@wmadden-electric

@wmadden-electric wmadden-electric commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

At a glance

After this PR, a Prisma 8 schema can define a reusable type once and give it generated values:

types {
  UpdatedAt = TimestampString(3) @onCreate(now()) @onUpdate(now())
}

model Post {
  id        String             @id @onCreate(uuid())
  createdAt temporal.CreatedAt
  updatedAt UpdatedAt
}
  • UpdatedAt is a type alias, a name for TimestampString(3). Any field typed UpdatedAt gets that column type and the current time on create and on every update.
  • temporal.CreatedAt is a type alias that Postgres provides, so users do not have to write their own.

Until now, an alias could not carry @onCreate or @onUpdate. The only way to say "set this timestamp on every update" was a field preset such as temporal.timestampString(3, onCreate: now, onUpdate: now).

The decision

A type alias is a shorthand in the schema file, and the contract does not store it. When Prisma reads the schema, each field typed by an alias gets the alias's type and attributes, exactly as if the user had written them on the field. The contract then records the column's real type. It no longer records the alias name.

So for this schema:

types {
  Slug = VarChar(64)
}

model Post {
  slug Slug
}

The contract used to store the alias, with a column that only pointed at it:

"types": { "Slug": { "codecId": "sql/varchar@1", "typeParams": { "length": 64 } } },
"slug":  { "codecId": "sql/varchar@1", "typeRef": "Slug" }

It now stores the column alone:

"slug": { "codecId": "sql/varchar@1", "typeParams": { "length": 64 } }

This is the second of three PRs for TML-3607, which carries out ADR 275. The first, #30780, made generated values attributes (@onCreate(uuid()) instead of @default(uuid())). This one makes aliases able to replace field presets. The third will remove field presets.

Why

The contract describes the database. An alias name exists only in the schema file: renaming Slug to ShortText changes nothing in the database, but it changed the contract's hash, so users had to sign their database again. Nothing in the runtime reads the alias name.

Aliases were stored because PSL once had no way to write a type with its parameters inline, such as VarChar(64). It has that now, so the alias can be resolved when the schema is read.

Once aliases can carry @onCreate and @onUpdate, they cover what field presets were for: a reusable column type with generated values. Unlike presets, any user can write one.

What users get

Aliases with generated values. An alias may set @default, @onCreate and @onUpdate. A field typed by the alias may add attributes the alias does not set. Prisma refuses the following, each with a message that says what to write instead:

  • @id or @unique on an alias, because those describe a model's field, not a type;
  • a field that repeats an attribute its alias already sets;
  • an alias defined as another alias.

Ready-made timestamp aliases. Postgres, SQLite and MongoDB each provide temporal.CreatedAt (the time a row is created) and temporal.UpdatedAt (the time it is created and every time it is updated). Postgres also has String and JsDate variants, for the other ways it can return a timestamp. Each one stores exactly what the matching field preset stores today. So the third PR can remove the presets without changing any user's contract. The editor completes these names and shows their documentation.

MongoDB schemas can use aliases. Before, MongoDB refused any field typed by an alias.

The same in TypeScript. An alias is a constant:

const UpdatedAt = field.column(type.TimestampString(3)).onCreate(gen.now()).onUpdate(gen.now());

updatedAt: UpdatedAt,
createdAt: field.column(type.temporal.CreatedAt()),

type.* now has a helper for every type PSL can write, such as type.VarChar(64). The types key in defineContract, which declared aliases, is removed. Using it is an error that says what to write instead.

What users must do

Every contract that uses a types {} block gets a new storage hash, because its columns change shape. The PR ships an upgrade script, upgrade-instructions/pending/expand-type-aliases/.

  • What the script does: it rewrites a project's stored contracts and migration snapshots to the new shape and updates their hashes.
  • What the user does: run the script, emit the contract again, then run prisma db sign.
  • The database itself: nothing changes, and no migration is needed.

Without the upgrade, Prisma refuses a stored contract that still holds an alias, and the error names the script.

Extension authors have a separate guide in the same folder.

How it was checked

  • No database change. Every saved migration plan and every example migration produces the same SQL as before. Only hashes changed.
  • The upgrade script. Run over this repository, it produced exactly what emitting the contracts again produces. Run over main's demo apps, it produced this branch's migrations. Its tests run Prisma's own migration checker on the result.
  • A real upgrade, by hand. A database was set up with main and then upgraded with this branch by following the guide. prisma db verify reports no issues. The report is projects/remove-field-presets/manual-qa-reports/2026-10-21-slice-2.md.
  • Review. Four rounds of /drive-code-review, all findings fixed. All repository checks pass.

Decisions ADR 275 left open

  • Extensions still declare database types in TypeScript. pgvector and PostGIS declare the types they create in the database (vector, geometry) through the removed types key, and PSL cannot write that. They now use a new key, databaseTypes, which means only that. Their contracts do not change.
  • A provided alias cannot set a database default. No pack needs one, and MongoDB has no database defaults. It can be added when a pack needs it.
  • MongoDB's aliases use Date, because MongoDB's DateTime is deprecated.
  • MongoDB's TypeScript builder gets no provided aliases. It has no type.* helpers to build them on. MongoDB TypeScript users write field.date().onCreate(gen.now()).onUpdate(gen.now()). This is recorded in projects/remove-field-presets/deferred.md.

ADR 275 and the ADRs it changes carry dated notes on these points.

Alternatives considered

  • Keep storing aliases in the contract. Not chosen: the hash would keep changing when a user renames an alias, though the database does not change.
  • Split this PR into the schema-language change and the contract change. Not chosen: an alias that sets a generated value only works once aliases are resolved when the schema is read, so the second PR would depend on the first.
  • Keep the TypeScript key named types for extensions. Not chosen: every existing types key in a user's app holds aliases, and would silently become a declaration of database types.

TML-3607 stays open until the third PR merges.

Agent: frankenstein-64

…by it

An alias resolves once at its declaration to a column type with its params
inline, plus its @default, @onCreate and @onUpdate, lowered for that column.
Each field typed by it takes the column type and the lowered attributes.
Nothing is written to storage.types and no column gets a typeRef.

@id and @unique on an alias are refused with their own message; any refused
attribute is dropped and the alias kept. A field that repeats an attribute
its alias sets is PSL_DUPLICATE_ATTRIBUTE. A list field typed by an alias
that sets a default or a generator is refused.

The family-neutral part (base classification, attribute filtering, repeat
check, the spec context an alias is read in) lives in @internal/psl-parser
so Mongo can reuse it. The @updatedat hint now names temporal.UpdatedAt.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…very PSL type constructor

The Postgres and SQLite targets now contribute the PSL scalar and native type
constructors, so PSL sees the same names and the TypeScript builder gains
type.String(), type.VarChar(64), type.TimestampString(3) and the rest. A
type.* helper with no parameters gives a column with no typeParams, as PSL does.

The contract types key is now databaseTypes and only registers a database
type in storage.types; pgvector and PostGIS use it, and their emitted
contracts are unchanged. defineContract refuses a types key with
CONTRACT.TYPES_KEY_REMOVED. field.namedType takes only an enum handle.
.default() on a field that already has a default throws
CONTRACT.DEFAULT_INVALID with reason default-set-twice.

The committed TypeScript contracts that used types or field.namedType on a
codec instance now write field.column(...) constants.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…emporal.CreatedAt and temporal.UpdatedAt

A pack may contribute a typeAlias in its type namespace: a column type with
fixed params, and the default and generator calls every field typed by it
takes. It takes no arguments. The control stack and the SQL and Mongo
TypeScript builders resolve each alias generator call against the assembled
generator functions through one shared function, and refuse a call that does
not resolve for the alias codec with CONTRACT.PACK_CONTRIBUTION_INVALID.

SQL PSL reads a field typed temporal.CreatedAt through the types {} alias
path: the field takes the column type and generators, may add an attribute
the alias does not set, and repeating one is PSL_DUPLICATE_ATTRIBUTE.
temporal.CreatedAt(3) is PSL_INVALID_ATTRIBUTE_ARGUMENT. SQL TypeScript
gets type.temporal.CreatedAt(); field.column copies its default and
generator calls into the field, which is then optional on create. The
language server completes and hovers an alias as a type with its
documentation.

Postgres contributes CreatedAt and UpdatedAt with String and JsDate
variants, SQLite and Mongo contribute CreatedAt and UpdatedAt. Each stores
what the matching preset stores; none sets a database default. Mongo PSL
still refuses a field typed by an alias.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
… into the fields typed by it

A Mongo field typed by a types {} alias, or by temporal.CreatedAt or
temporal.UpdatedAt, takes the alias type and the values its @onCreate and
@onUpdate generate, keyed by the stored field name. Each alias resolves once,
so a generator that does not apply is reported once, at the alias.

MongoDB has no database defaults, so @default on an alias is refused at the
alias with the @onCreate(now()) hint. A field typed by a generating alias is
refused when it is optional, a list, or a composite type member; a variant
field is refused as any generated value is. A field that repeats an attribute
its alias sets is PSL_DUPLICATE_ATTRIBUTE, and a field typed by an alias may
not take arguments.

A bare type constructor keeps its fixed type params. The refusal of @id and
@unique on an alias moves to the shared alias helper, which now takes the
attributes a family accepts. The Mongo @updatedat hint names
temporal.UpdatedAt.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…s branch

StorageColumn and ColumnTypeDescriptor have no typeRef, and the column schema
has no such key. A stored contract whose columns hold typeRef is refused after
the nativeType and noCheck checks, naming the first five columns and pointing
at expand-type-aliases.ts. storage.types keeps its schema and now holds only
the database types a contract space registers. resolvedTypeParams is replaced
by nonEmptyTypeParams, which reads a column's own params.

The emitter writes no typeRef and resolves column types from the column's own
params. The runtime drops ExecutionContext.types, TypeHelperRegistry and the
alias pass of the codec registry, so a parameterized column's codec instance is
named <col:Table.column>, shared by every column with equal params.
codecRefForStorageColumn keeps the list flag. contractToSchemaIR, the Postgres
and SQLite DDL builders, the identity values, reported defaults, the stack
checks and the field event planner read the column alone; the planner no
longer takes storageTypes, and the codec hooks still run for storage.types.

contract print writes no types {} block and refuses a contract that registers
database types. buildContractDefinition and buildSqlContractFromDefinition
refuse a types key with CONTRACT.TYPES_KEY_REMOVED. A SQL PSL field that calls
a types {} alias is refused as calling a type alias, as in Mongo.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…ts columns

The upgrade script replaces every column typeRef in a stored SQL contract with the referenced storage.types entry's params, removes each referenced entry, keeps and lists entries no column references, and rewrites contract.d.ts, snapshot directories, migrations, refs and migration.ts as remove-nocheck.ts does. The app and extension copies are byte-identical.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…s in its columns

Ran expand-type-aliases.ts over the examples, the Supabase space contract, the sql-orm-client and ports fixtures, the contract-format fixtures and the postgres-extension-space and sqlite-project fixtures of two earlier upgrade fragments, then re-emitted with pnpm fixtures:emit, which changed nothing further. Tests that pinned old hashes or the stored Supabase aliases now pin the expanded contracts.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…n into its columns

The expand-type-aliases fragment lists every consumer change for apps and extensions. ADRs 104, 159, 208, 212, 241, 254 and 275 carry dated amendments; the subsystem docs, READMEs, error reference and the contract skill reference describe aliases as authoring shorthand and databaseTypes as the only storage.types writer.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…scriptor default

The type alias descriptor reuses the framework column default types (AuthoringColumnDefaultTemplate, ColumnDefault) at three lines, and the shared alias refusal names a column type as the spec words it, so the threshold rises from 237 to 241. A local variable in type-aliases.ts no longer says column.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…tribute take values of data types

Main brought TML-3615, TML-3674 and TML-3604. The type constructors this branch moved to the targets keep main's value arguments, and the target type namespaces keep main's sql.String next to the temporal aliases. contributedHelpers skips type aliases, as contributedConstructors did. The value-object and named-type paths take main's dataTypes. The tests this branch added declare value arguments, and the Postgres interpreter test helper names the fixture text data types. The framework vocabulary threshold stays at main's 237.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…pes as the fixture list

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…he vocabulary threshold stays at 237

Each family supplies the word in the @id and @unique refusal of a type alias: the SQL interpreter says column type, and the Mongo interpreter says field type. A contributed type alias stores its default as the database default a @default lowers to, typed through LoweredDefaultValue, because an alias takes no arguments and so needs no default template.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…, and assembly checks its params and its generators for its length

A contributed alias no longer has a database default: no pack sets one, and it was a SQL concept on a framework descriptor. Assembly now checks the alias's fixed type params against its codec's params schema, and resolves its generator calls for the length the family gives those params, so a broken pack is refused with CONTRACT.PACK_CONTRIBUTION_INVALID before a schema is read.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…alias, and one sentence refuses @id and @unique on it in both families

The refusal of @id and @unique no longer needs a family word, so the typeNoun parameter goes. The diagnostic codes keep their names.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…abaseTypes, as defineContract does

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…hat they hold, since they feed PSL and TypeScript alike

ADR 241 now says the target contributes them, so they are also type.* helpers.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…s and ResolvedTypeAliases, as the SQL resolver does

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…efore two snapshots become one

In the app's own contract space the script now removes every storage.types entry no column references, so an alias the source declares but nothing uses leaves the contract as a re-emit does. It keeps such entries only in an extension's space, which it tells by the migrations directory that names the snapshot. Before writing, it stops when a migration or ref names two snapshots that become the same one, and names the migration between them. Tests cover both, and the three stop cases that had none. The instructions run the script, re-emit, then sign.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…de script wrote and a re-emit of its source

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…tops before two snapshots become one

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…data operation, keeps the entries of unnamed snapshots, and lists what it removed

Two snapshots that become one stop the script only when a migration between them has no operation of class data, the rule the migration checker uses. The stop says only to delete that migration directory and run again; the next run rewrites every reference and migrationHash. A snapshot that no migration or ref names keeps its unreferenced storage.types entries. The summary lists every storage.types entry the script removed, per contract.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…try, and an extension author to re-emit, publish and have apps sign

An app's own contract space never needs a registered database type, so the TypeScript section tells a user to delete a codec-instance entry no field uses and to write a used one as a field.column constant. The guides describe the narrowed stop for two snapshots that become one, the unnamed snapshot rule and the removed-entries summary. The extension guide says what to do when a re-emit changes the bundled storage hash. Spec D11 gives the corrected reasons.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…ases are tested

A Postgres TypeScript contract with an extension that contributes a type alias is refused when the generator does not fit the column length or the codec refuses the fixed params. The Mongo builder is refused when the codec refuses the fixed params. Each test fails when its lookup is replaced by one that returns undefined.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…ma, the refusals, TypeScript, MongoDB and the language server through the CLI

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…gration it says to delete, and stops naming an ops.json that does not parse

When a migration between two snapshots that become one is the app's latest, nothing else names its target snapshot, so the stop line now names that snapshot directory to delete too. A migration whose ops.json is not valid JSON gets the not-valid-JSON stop instead of advice to delete it. The merge tests move to their own file and cover keeping an existing merged directory and merging two changed snapshots after an alias rename.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…n a re-emit drops an unused alias, so the head ref names the bundled contract

The script keeps an unused alias in an extension's space, and each application gets that hash for its copy of the extension's migrations. When the re-emit drops the alias, the author now writes a migration with no operations from the head hash to the re-emitted hash, adds its snapshot and moves the head ref, instead of publishing a bundled contract the head ref does not name.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…lias, and say what to write instead

An alias written as another alias says what to write: the other alias's type constructor and attributes, or, for a contributed alias, to type the fields with it or write a type constructor with its generator attributes. A list field typed by a generating alias names the alias in SQL, as it already did in MongoDB. The TypeScript phase refusal, the MongoDB write-time refusals and the registry collision message no longer call an alias a field preset.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…ompletion tells the String and JsDate variants apart

temporalTypeAliases takes the TypeScript value the codec gives and ends each alias's documentation with it: a Temporal.Instant, a string as Postgres writes it, or a JavaScript Date.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…, and how an extension handles an alias a re-emit drops

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…eds in the descriptor, and to import the extension's own target's migration module

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…the script, and that this is expected

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…chain, suggests nothing for a cycle, leaves out comments, and names the type constructor of a contributed alias

The suggested line is built from the syntax nodes of the type and attributes, so a comment no longer swallows an attribute. A chain is followed to its first base that is not an alias, with the attributes of every alias in it. For a contributed alias, the line names the first type constructor of the stack that gives the alias's type, such as X = DateTime @onCreate(now()) @onUpdate(now()) on Postgres.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
@wmadden-electric
wmadden-electric requested a review from a team as a code owner October 21, 2026 14:10
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 379 files, which is 79 over the limit of 300.

To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch.

Usage-priced reviews support at most 300 files.

⚙️ Run configuration
  • Configuration used: Repository: prisma/orm/.coderabbit.yml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b1a1681a-09d9-48f4-866b-754258d111b9
📥 Commits

Reviewing files that changed from the base of the PR and between 95eeb76 and ce1d5f2.

⛔ Files ignored due to path filters: 25
  • packages/3-extensions/sql-orm-client/test/fixtures/collection-methods/generated/contract.d.ts is excluded by !**/generated/**
  • packages/3-extensions/sql-orm-client/test/fixtures/collection-methods/generated/contract.json is excluded by !**/generated/**
  • projects/remove-field-presets/deferred.md is excluded by !projects/**
  • projects/remove-field-presets/manual-qa-reports/2026-10-21-slice-2.md is excluded by !projects/**
  • projects/remove-field-presets/manual-qa.md is excluded by !projects/**
  • projects/remove-field-presets/slices/02-alias-expansion/spec.md is excluded by !projects/**
  • projects/remove-field-presets/spec.md is excluded by !projects/**
  • test/integration/test/contract-parity/fixtures/postgres/generated/contract.d.ts is excluded by !**/generated/**
  • test/integration/test/contract-parity/fixtures/postgres/generated/contract.json is excluded by !**/generated/**
  • test/integration/test/mongo/temporal-presets/_fixture-aliases/generated/contract.d.ts is excluded by !**/generated/**
  • test/integration/test/mongo/temporal-presets/_fixture-aliases/generated/contract.json is excluded by !**/generated/**
  • test/integration/test/planner-golden/fixtures/postgres/generated/contract.d.ts is excluded by !**/generated/**
  • test/integration/test/planner-golden/fixtures/postgres/generated/contract.json is excluded by !**/generated/**
  • test/integration/test/planner-golden/fixtures/sqlite/generated/contract.d.ts is excluded by !**/generated/**
  • test/integration/test/planner-golden/fixtures/sqlite/generated/contract.json is excluded by !**/generated/**
  • test/integration/test/ports/engines/queries/filters/decimal_filter/_fixture/generated/contract.d.ts is excluded by !**/generated/**
  • test/integration/test/ports/engines/queries/filters/decimal_filter/_fixture/generated/contract.json is excluded by !**/generated/**
  • test/integration/test/ports/prisma/functional/decimal-list/_fixture/generated/contract.d.ts is excluded by !**/generated/**
  • test/integration/test/ports/prisma/functional/decimal-list/_fixture/generated/contract.json is excluded by !**/generated/**
  • test/integration/test/ports/prisma/functional/decimal-precision/_fixture/generated/contract.d.ts is excluded by !**/generated/**
  • test/integration/test/ports/prisma/functional/decimal-precision/_fixture/generated/contract.json is excluded by !**/generated/**
  • test/integration/test/sql-orm-client/fixtures/collection-methods/generated/contract.d.ts is excluded by !**/generated/**
  • test/integration/test/sql-orm-client/fixtures/collection-methods/generated/contract.json is excluded by !**/generated/**
  • test/integration/test/temporal-defaults/_fixture-aliases/generated/contract.d.ts is excluded by !**/generated/**
  • test/integration/test/temporal-defaults/_fixture-aliases/generated/contract.json is excluded by !**/generated/**
📒 Files selected for processing: 379
  • biome.jsonc
  • docs/architecture docs/adrs/ADR 104 - PSL extension namespacing & syntax.md
  • docs/architecture docs/adrs/ADR 159 - Definition-only contracts and type-only codec-operation maps.md
  • docs/architecture docs/adrs/ADR 169 - On-disk migration persistence.md
  • docs/architecture docs/adrs/ADR 208 - Higher-order codecs for parameterized types.md
  • docs/architecture docs/adrs/ADR 212 - AST-bound codec resolution.md
  • docs/architecture docs/adrs/ADR 241 - Scalar types use the authoring type-constructor channel.md
  • docs/architecture docs/adrs/ADR 254 - Data types and casts.md
  • docs/architecture docs/adrs/ADR 275 - Client generators are field attributes, and a type alias is expanded into each column.md
  • docs/architecture docs/subsystems/1. Data Contract.md
  • docs/architecture docs/subsystems/2. Contract Emitter & Types.md
  • docs/reference/error-reference.md
  • docs/reference/integer-representation-types.md
  • examples/prisma-8-demo-sqlite/prisma/contract.ts
  • examples/prisma-8-demo-sqlite/src/prisma/contract.d.ts
  • examples/prisma-8-demo-sqlite/src/prisma/contract.json
  • examples/prisma-8-demo/migrations/app/20260422T0720_initial/migration.json
  • examples/prisma-8-demo/migrations/app/20260422T0720_initial/migration.ts
  • examples/prisma-8-demo/migrations/app/20260810T1108_add_post_engagement_counters/migration.json
  • examples/prisma-8-demo/migrations/app/20260810T1108_add_post_engagement_counters/migration.ts
  • examples/prisma-8-demo/migrations/app/20260917T0818_add_post_expires_at/migration.json
  • examples/prisma-8-demo/migrations/app/20260917T0818_add_post_expires_at/migration.ts
  • examples/prisma-8-demo/migrations/app/20260922T1218_add_post_title_search/migration.json
  • examples/prisma-8-demo/migrations/app/20260922T1218_add_post_title_search/migration.ts
  • examples/prisma-8-demo/migrations/app/20261009T1354_add_post_body_search/migration.json
  • examples/prisma-8-demo/migrations/app/20261009T1354_add_post_body_search/migration.ts
  • examples/prisma-8-demo/migrations/snapshots/0ce16e4140d056a3abddbe18bd7ee5198d392370f0aeb23236216c51505944de/contract.d.ts
  • examples/prisma-8-demo/migrations/snapshots/0ce16e4140d056a3abddbe18bd7ee5198d392370f0aeb23236216c51505944de/contract.json
  • examples/prisma-8-demo/migrations/snapshots/0ce1b6cf3e03ac1498f39eb8ef08d36d73ee2f0bc7fe368b97f1497ba050501a/contract.d.ts
  • examples/prisma-8-demo/migrations/snapshots/0ce1b6cf3e03ac1498f39eb8ef08d36d73ee2f0bc7fe368b97f1497ba050501a/contract.json
  • examples/prisma-8-demo/migrations/snapshots/58888a20cba5529ede90056ecd1318183f0e5cf280c88cd58aeadd94bbf52c1b/contract.d.ts
  • examples/prisma-8-demo/migrations/snapshots/58888a20cba5529ede90056ecd1318183f0e5cf280c88cd58aeadd94bbf52c1b/contract.json
  • examples/prisma-8-demo/migrations/snapshots/6e6fbbc22d1d4904fbc8668644c5cabe694d946e550a2f0cdd07aaab308b953f/contract.d.ts
  • examples/prisma-8-demo/migrations/snapshots/6e6fbbc22d1d4904fbc8668644c5cabe694d946e550a2f0cdd07aaab308b953f/contract.json
  • examples/prisma-8-demo/migrations/snapshots/9fc3736e0efd980892a19f4d704ca30bcd0de243080e78ed1279b1f3a50f9a7e/contract.d.ts
  • examples/prisma-8-demo/migrations/snapshots/9fc3736e0efd980892a19f4d704ca30bcd0de243080e78ed1279b1f3a50f9a7e/contract.json
  • examples/prisma-8-demo/migrations/snapshots/a6e86cb536b51ac3b7542cb02dbf9f5004139e8dc5ee1b33a554c436d8cd2b2a/contract.d.ts
  • examples/prisma-8-demo/migrations/snapshots/a6e86cb536b51ac3b7542cb02dbf9f5004139e8dc5ee1b33a554c436d8cd2b2a/contract.json
  • examples/prisma-8-demo/migrations/snapshots/d44ab6f7caddcc384332c669737008aec7ec8c9f5b013cb502a03c2eb04be9c0/contract.d.ts
  • examples/prisma-8-demo/migrations/snapshots/d44ab6f7caddcc384332c669737008aec7ec8c9f5b013cb502a03c2eb04be9c0/contract.json
  • examples/prisma-8-demo/prisma/contract.ts
  • examples/prisma-8-demo/src/prisma/contract.d.ts
  • examples/prisma-8-demo/src/prisma/contract.json
  • examples/prisma-8-postgis-demo/migrations/app/20260512T1309_migration/migration.json
  • examples/prisma-8-postgis-demo/migrations/app/20260512T1309_migration/migration.ts
  • examples/prisma-8-postgis-demo/migrations/snapshots/28b5e5f98ce0e148f03e345518c9c53cb7a04a82e8e58de74a87c1b4ae08cf65/contract.d.ts
  • examples/prisma-8-postgis-demo/migrations/snapshots/28b5e5f98ce0e148f03e345518c9c53cb7a04a82e8e58de74a87c1b4ae08cf65/contract.json
  • examples/prisma-8-postgis-demo/src/prisma/contract.d.ts
  • examples/prisma-8-postgis-demo/src/prisma/contract.json
  • packages/1-framework/1-core/framework-components/src/control/control-descriptors.ts
  • packages/1-framework/1-core/framework-components/src/control/control-stack.ts
  • packages/1-framework/1-core/framework-components/src/control/psl-ast.ts
  • packages/1-framework/1-core/framework-components/src/exports/authoring.ts
  • packages/1-framework/1-core/framework-components/src/shared/authoring-type-constructor-call.ts
  • packages/1-framework/1-core/framework-components/src/shared/codec-types.ts
  • packages/1-framework/1-core/framework-components/src/shared/column-spec.ts
  • packages/1-framework/1-core/framework-components/src/shared/data-type-support.ts
  • packages/1-framework/1-core/framework-components/src/shared/framework-authoring.ts
  • packages/1-framework/1-core/framework-components/src/shared/temporal-presets.ts
  • packages/1-framework/1-core/framework-components/test/control-stack.generator-functions.test.ts
  • packages/1-framework/1-core/framework-components/test/control-stack.test.ts
  • packages/1-framework/2-authoring/contract/src/field-preset-helpers.ts
  • packages/1-framework/2-authoring/psl-parser/src/attribute-spec/field-attribute.ts
  • packages/1-framework/2-authoring/psl-parser/src/attribute-spec/generator-attribute.ts
  • packages/1-framework/2-authoring/psl-parser/src/attribute-spec/spec-context.ts
  • packages/1-framework/2-authoring/psl-parser/src/binder.ts
  • packages/1-framework/2-authoring/psl-parser/src/contributed-type-scope.ts
  • packages/1-framework/2-authoring/psl-parser/src/exports/index.ts
  • packages/1-framework/2-authoring/psl-parser/src/type-aliases.ts
  • packages/1-framework/2-authoring/psl-parser/test/binder.mixin.test.ts
  • packages/1-framework/2-authoring/psl-parser/test/binder.test.ts
  • packages/1-framework/2-authoring/psl-parser/test/mixin-placement.test.ts
  • packages/1-framework/2-authoring/psl-parser/test/type-aliases.test.ts
  • packages/1-framework/3-tooling/language-server/src/completion-provider.ts
  • packages/1-framework/3-tooling/language-server/src/completion-scope.ts
  • packages/1-framework/3-tooling/language-server/src/completion-snippets.ts
  • packages/1-framework/3-tooling/language-server/src/hover.ts
  • packages/1-framework/3-tooling/language-server/test/completion-provider.test.ts
  • packages/1-framework/3-tooling/language-server/test/hover.test.ts
  • packages/2-mongo-family/2-authoring/contract-psl/README.md
  • packages/2-mongo-family/2-authoring/contract-psl/src/interpreter.ts
  • packages/2-mongo-family/2-authoring/contract-psl/src/mongo-attribute-specs.ts
  • packages/2-mongo-family/2-authoring/contract-psl/src/type-aliases.ts
  • packages/2-mongo-family/2-authoring/contract-psl/test/interpreter.aliases.test.ts
  • packages/2-mongo-family/2-authoring/contract-psl/test/interpreter.attribute-specs.test.ts
  • packages/2-mongo-family/2-authoring/contract-psl/test/interpreter.temporal-presets.test.ts
  • packages/2-mongo-family/2-authoring/contract-psl/test/interpreter.test.ts
  • packages/2-mongo-family/2-authoring/contract-psl/test/interpreter.type-params.test.ts
  • packages/2-mongo-family/2-authoring/contract-ts/src/contract-builder.ts
  • packages/2-mongo-family/2-authoring/contract-ts/test/contract-builder.execution-defaults.test-d.ts
  • packages/2-mongo-family/2-authoring/contract-ts/test/contract-builder.execution-defaults.test.ts
  • packages/2-mongo-family/2-authoring/contract-ts/test/contract-builder.generator-calls.test.ts
  • packages/2-sql/1-core/contract/src/exports/types.ts
  • packages/2-sql/1-core/contract/src/ir/storage-column.ts
  • packages/2-sql/1-core/contract/src/ir/storage-entry-schemas.ts
  • packages/2-sql/1-core/contract/src/ir/storage-type-instance.ts
  • packages/2-sql/1-core/contract/src/types.ts
  • packages/2-sql/1-core/contract/src/validators.ts
  • packages/2-sql/1-core/contract/src/value-type-maps.ts
  • packages/2-sql/1-core/contract/test/non-empty-type-params.test.ts
  • packages/2-sql/1-core/contract/test/resolved-type-params.test.ts
  • packages/2-sql/1-core/contract/test/validators.test.ts
  • packages/2-sql/1-core/contract/test/value-type-maps.types.test-d.ts
  • packages/2-sql/1-core/schema-ir/src/ir/sql-column-ir.ts
  • packages/2-sql/2-authoring/contract-psl/README.md
  • packages/2-sql/2-authoring/contract-psl/src/data-type-default.ts
  • packages/2-sql/2-authoring/contract-psl/src/interpreter.ts
  • packages/2-sql/2-authoring/contract-psl/src/psl-column-resolution.ts
  • packages/2-sql/2-authoring/contract-psl/src/psl-field-resolution.ts
  • packages/2-sql/2-authoring/contract-psl/src/psl-named-type-resolution.ts
  • packages/2-sql/2-authoring/contract-psl/src/sql-attribute-specs.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter-defaults-support.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.alias-attributes.test.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.alias-expansion.test.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.bare-name-sugar.test.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.contributed-aliases.test.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.defaults.generator-storage.test.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.defaults.presets.test.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.diagnostics.test.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.entity-ref-type-constructor.test.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.enum.test.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.extensions.test.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.field-type-resolution.test.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.mixins.test.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.polymorphism.test.ts
  • packages/2-sql/2-authoring/contract-psl/test/interpreter.types.test.ts
  • packages/2-sql/2-authoring/contract-ts/API.md
  • packages/2-sql/2-authoring/contract-ts/DEVELOPING.md
  • packages/2-sql/2-authoring/contract-ts/README.md
  • packages/2-sql/2-authoring/contract-ts/schemas/data-contract-sql-v1.json
  • packages/2-sql/2-authoring/contract-ts/src/authoring-helper-runtime.ts
  • packages/2-sql/2-authoring/contract-ts/src/build-contract.ts
  • packages/2-sql/2-authoring/contract-ts/src/composed-authoring-helpers.ts
  • packages/2-sql/2-authoring/contract-ts/src/contract-builder.ts
  • packages/2-sql/2-authoring/contract-ts/src/contract-definition.ts
  • packages/2-sql/2-authoring/contract-ts/src/contract-dsl.ts
  • packages/2-sql/2-authoring/contract-ts/src/contract-errors.ts
  • packages/2-sql/2-authoring/contract-ts/src/contract-lowering.ts
  • packages/2-sql/2-authoring/contract-ts/src/contract-types.ts
  • packages/2-sql/2-authoring/contract-ts/src/contract-warnings.ts
  • packages/2-sql/2-authoring/contract-ts/src/describe-model.ts
  • packages/2-sql/2-authoring/contract-ts/src/domain-fields.ts
  • packages/2-sql/2-authoring/contract-ts/src/lower-column.ts
  • packages/2-sql/2-authoring/contract-ts/src/refuse-types-key.ts
  • packages/2-sql/2-authoring/contract-ts/test/authoring-integer-representation-types.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/build-contract.type-names.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/column-node.equation.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/contract-builder.constraints.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/contract-builder.contract-definition.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/contract-builder.dsl.helpers.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/contract-builder.dsl.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/contract-builder.index-naming.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/contract-builder.named-type-domain.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/contract-dsl.alias-constants.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/contract-lowering.runtime.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/contract-warnings.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/contract.parameterized-types.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/enum-type.authoring.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/enum-type.codec-encoding.test.ts
  • packages/2-sql/2-authoring/contract-ts/test/value-object-member-has-no-column.test-d.ts
  • packages/2-sql/3-tooling/emitter/src/index.ts
  • packages/2-sql/3-tooling/emitter/test/emitter-hook.parameterized-types.test.ts
  • packages/2-sql/3-tooling/emitter/test/emitter-hook.storage-column-types.test.ts
  • packages/2-sql/3-tooling/emitter/test/emitter.column-type-params.test.ts
  • packages/2-sql/4-lanes/relational-core/src/ast/codec-types.ts
  • packages/2-sql/4-lanes/relational-core/src/codec-ref-for-column.ts
  • packages/2-sql/4-lanes/relational-core/src/query-lane-context.ts
  • packages/2-sql/4-lanes/relational-core/test/codec-descriptor-registry.test.ts
  • packages/2-sql/4-lanes/relational-core/test/codec-ref-for-column.test.ts
  • packages/2-sql/4-lanes/relational-core/test/utils.ts
  • packages/2-sql/4-lanes/sql-builder/test/runtime/field-proxy.test.ts
  • packages/2-sql/5-runtime/README.md
  • packages/2-sql/5-runtime/src/exports/index.ts
  • packages/2-sql/5-runtime/src/sql-context.ts
  • packages/2-sql/5-runtime/test/codec-integrity.test.ts
  • packages/2-sql/5-runtime/test/contract-codec-registry.test.ts
  • packages/2-sql/5-runtime/test/execution-stack.test.ts
  • packages/2-sql/5-runtime/test/parameterized-types.test.ts
  • packages/2-sql/5-runtime/test/sql-context.codec-context.test.ts
  • packages/2-sql/5-runtime/test/sql-context.test.ts
  • packages/2-sql/9-family/src/core/contract-stack-checks.ts
  • packages/2-sql/9-family/src/core/control-descriptor.ts
  • packages/2-sql/9-family/src/core/migrations/contract-to-schema-ir.ts
  • packages/2-sql/9-family/src/core/migrations/field-event-planner.ts
  • packages/2-sql/9-family/src/core/reported-defaults.ts
  • packages/2-sql/9-family/test/contract-to-schema-ir.error-codes.test.ts
  • packages/2-sql/9-family/test/contract-to-schema-ir.test.ts
  • packages/2-sql/9-family/test/reported-defaults.test.ts
  • packages/3-extensions/pgvector/src/contract.ts
  • packages/3-extensions/pgvector/test/contract-declaration-portability.fixture.ts
  • packages/3-extensions/pgvector/test/default-encoding.test.ts
  • packages/3-extensions/pgvector/test/default-input-type.test-d.ts
  • packages/3-extensions/pgvector/test/migrations/planner.behavior.test.ts
  • packages/3-extensions/pgvector/test/migrations/planner.contract-to-schema-ir.test.ts
  • packages/3-extensions/pgvector/test/migrations/planner.storage-types.test.ts
  • packages/3-extensions/postgis/README.md
  • packages/3-extensions/postgis/src/contract.ts
  • packages/3-extensions/postgres/src/contract/define-contract.ts
  • packages/3-extensions/postgres/test/contract-builder/default-input-type.test-d.ts
  • packages/3-extensions/postgres/test/contract-builder/native-enum-typeof.test-d.ts
  • packages/3-extensions/postgres/test/contract-builder/native-enum.test.ts
  • packages/3-extensions/postgres/test/contract-builder/type-helpers.test-d.ts
  • packages/3-extensions/postgres/test/native-type-parity.test.ts
  • packages/3-extensions/sql-orm-client/test/declared-fields-fragment.test.ts
  • packages/3-extensions/sqlite/src/contract/define-contract.ts
  • packages/3-extensions/sqlite/test/contract-builder/type-helpers.test-d.ts
  • packages/3-extensions/supabase/src/contract/contract.d.ts
  • packages/3-extensions/supabase/src/contract/contract.json
  • packages/3-extensions/supabase/src/runtime/supabase.ts
  • packages/3-extensions/supabase/test/contract-completeness.test.ts
  • packages/3-mongo-target/1-mongo-target/src/core/authoring.ts
  • packages/3-mongo-target/1-mongo-target/src/core/descriptor-meta.ts
  • packages/3-mongo-target/1-mongo-target/test/descriptor-meta.test.ts
  • packages/3-targets/3-targets/postgres/src/core/authoring.ts
  • packages/3-targets/3-targets/postgres/src/core/descriptor-meta.ts
  • packages/3-targets/3-targets/postgres/src/core/migrations/column-ddl-rendering.ts
  • packages/3-targets/3-targets/postgres/src/core/migrations/issue-planner.ts
  • packages/3-targets/3-targets/postgres/src/core/migrations/planner-ddl-builders.ts
  • packages/3-targets/3-targets/postgres/src/core/migrations/planner-identity-values.ts
  • packages/3-targets/3-targets/postgres/src/core/migrations/planner-strategies.ts
  • packages/3-targets/3-targets/postgres/src/core/migrations/planner-type-resolution.ts
  • packages/3-targets/3-targets/postgres/src/core/migrations/planner.ts
  • packages/3-targets/3-targets/postgres/src/core/prisma7-type-map.ts
  • packages/3-targets/3-targets/postgres/src/core/psl-print/column-defaults.ts
  • packages/3-targets/3-targets/postgres/src/core/psl-print/column-types.ts
  • packages/3-targets/3-targets/postgres/src/core/psl-print/domain-types.ts
  • packages/3-targets/3-targets/postgres/src/core/psl-print/psl-contract.ts
  • packages/3-targets/3-targets/postgres/src/core/psl-print/refusals.ts
  • packages/3-targets/3-targets/postgres/src/core/psl-print/scalar-fields.ts
  • packages/3-targets/3-targets/postgres/src/core/type-constructors.ts
  • packages/3-targets/3-targets/postgres/src/exports/control.ts
  • packages/3-targets/3-targets/postgres/test/default-fidelity.integration.test.ts
  • packages/3-targets/3-targets/postgres/test/existing-column-types-without-temporal.test.ts
  • packages/3-targets/3-targets/postgres/test/fixtures/snapshot-read-shapes/codec-instance.json
  • packages/3-targets/3-targets/postgres/test/migrations/column-type-comparison.test.ts
  • packages/3-targets/3-targets/postgres/test/migrations/native-enum-planner.add-value.test.ts
  • packages/3-targets/3-targets/postgres/test/migrations/native-enum-planner.test.ts
  • packages/3-targets/3-targets/postgres/test/migrations/node-issue-planner-fixtures.ts
  • packages/3-targets/3-targets/postgres/test/migrations/node-issue-planner.test.ts
  • packages/3-targets/3-targets/postgres/test/migrations/planner.check-constraints.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-build/marked-type-constructors.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/fixtures.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/infer-psl-contract-described-contracts.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-infer/inferred-psl.round-trip.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-pg-enum-column.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-print/build-context.ts
  • packages/3-targets/3-targets/postgres/test/psl-print/refusals-database-types.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-print/refusals-entries.test.ts
  • packages/3-targets/3-targets/postgres/test/psl-print/refusals-named-types.test.ts
  • packages/3-targets/3-targets/postgres/test/type-constructors.test.ts
  • packages/3-targets/3-targets/sqlite/src/core/authoring.ts
  • packages/3-targets/3-targets/sqlite/src/core/descriptor-meta.ts
  • packages/3-targets/3-targets/sqlite/src/core/migrations/issue-planner.ts
  • packages/3-targets/3-targets/sqlite/src/core/migrations/op-factory-call.ts
  • packages/3-targets/3-targets/sqlite/src/core/migrations/operations/shared.ts
  • packages/3-targets/3-targets/sqlite/src/core/migrations/planner-ddl-builders.ts
  • packages/3-targets/3-targets/sqlite/src/core/type-constructors.ts
  • packages/3-targets/3-targets/sqlite/src/exports/control.ts
  • packages/3-targets/3-targets/sqlite/test/planner-ddl-builders.test.ts
  • packages/3-targets/3-targets/sqlite/test/structured-errors.test.ts
  • packages/3-targets/3-targets/sqlite/test/type-constructors.test.ts
  • packages/3-targets/6-adapters/postgres/src/core/control-adapter.ts
  • packages/3-targets/6-adapters/postgres/src/exports/control.ts
  • packages/3-targets/6-adapters/postgres/test/control-stack.type-aliases.test.ts
  • packages/3-targets/6-adapters/postgres/test/descriptor-meta.test.ts
  • packages/3-targets/6-adapters/postgres/test/migrations/planner-ddl-builders.test.ts
  • packages/3-targets/6-adapters/sqlite/src/exports/control.ts
  • packages/3-targets/6-adapters/sqlite/test/descriptor-meta.test.ts
  • skills/prisma-8/references/contract.md
  • test/e2e/framework/test/declaration-emit/sources/pgvector.ts
  • test/integration/package.json
  • test/integration/test/authoring/contributed-type-alias-assembly.test.ts
  • test/integration/test/authoring/parity/callback-mode-scalars/contract.ts
  • test/integration/test/authoring/parity/callback-mode-scalars/expected.contract.json
  • test/integration/test/authoring/parity/core-surface/contract.ts
  • test/integration/test/authoring/parity/core-surface/expected.contract.json
  • test/integration/test/authoring/parity/pgvector-named-type/contract.ts
  • test/integration/test/authoring/parity/pgvector-named-type/expected.contract.json
  • test/integration/test/authoring/parity/temporal-type-aliases.real-packs.test.ts
  • test/integration/test/authoring/parity/ts-psl-parity.real-packs.test.ts
  • test/integration/test/contract-builder.types.test-d.ts
  • test/integration/test/contract-format/cli-contract-loading.test.ts
  • test/integration/test/contract-format/supabase-before-dbgenerated-removal.test.ts
  • test/integration/test/contract-parity/define-contract-sections.test-d.ts
  • test/integration/test/contract-parity/fixtures/postgres/contract.ts
  • test/integration/test/cross-package/postgres-issue-planner.test.ts
  • test/integration/test/fixtures/cli/cli-integration-test-app/fixtures/emit-command/contract.parity.ts
  • test/integration/test/fixtures/contract-format/supabase-before-dbgenerated-removal.contract.json
  • test/integration/test/mongo/temporal-presets/_fixture-aliases/contract.prisma
  • test/integration/test/mongo/temporal-presets/_fixture-aliases/prisma.config.ts
  • test/integration/test/mongo/temporal-presets/type-aliases-parity.test.ts
  • test/integration/test/planner-golden/fixtures/postgres/contract.ts
  • test/integration/test/planner-golden/fixtures/sqlite/contract.ts
  • test/integration/test/psl-infer/marked-types-round-trip.integration.test.ts
  • test/integration/test/psl-print/every-postgres-contract-roundtrip.integration.test.ts
  • test/integration/test/psl-print/extension-types-roundtrip.integration.test.ts
  • test/integration/test/psl-print/raw-columns-roundtrip.integration.test.ts
  • test/integration/test/scalar-lists/psl-list-authoring.ts
  • test/integration/test/temporal-defaults/_fixture-aliases/contract.prisma
  • test/integration/test/temporal-defaults/_fixture-aliases/prisma.config.ts
  • test/integration/test/temporal-defaults/type-aliases-parity.test.ts
  • test/integration/test/upgrade-instructions/data-type-in-contract/data-type-in-contract-storage-hashes.test.ts
  • test/integration/test/upgrade-instructions/data-type-in-contract/fixtures/postgres-extension-space/after/migrations/app/20260201T0000_add_embedding/migration.json
  • test/integration/test/upgrade-instructions/data-type-in-contract/fixtures/postgres-extension-space/after/migrations/app/20260201T0000_add_embedding/migration.ts
  • test/integration/test/upgrade-instructions/data-type-in-contract/fixtures/postgres-extension-space/after/migrations/app/refs/head.json
  • test/integration/test/upgrade-instructions/data-type-in-contract/fixtures/postgres-extension-space/after/migrations/snapshots/adc839d7d404a69ced856b2528efb74e4f4aebb1b5401833b20c4ba144a791a5/contract.d.ts
  • test/integration/test/upgrade-instructions/data-type-in-contract/fixtures/postgres-extension-space/after/migrations/snapshots/adc839d7d404a69ced856b2528efb74e4f4aebb1b5401833b20c4ba144a791a5/contract.json
  • test/integration/test/upgrade-instructions/data-type-in-contract/fixtures/postgres-extension-space/after/prisma/contract.d.ts
  • test/integration/test/upgrade-instructions/data-type-in-contract/fixtures/postgres-extension-space/after/prisma/contract.json
  • test/integration/test/upgrade-instructions/data-type-in-contract/fixtures/postgres-extension-space/before/migrations/app/20260201T0000_add_embedding/migration.json
  • test/integration/test/upgrade-instructions/data-type-in-contract/fixtures/postgres-extension-space/before/migrations/app/20260201T0000_add_embedding/migration.ts
  • test/integration/test/upgrade-instructions/data-type-in-contract/fixtures/postgres-extension-space/before/migrations/app/refs/head.json
  • test/integration/test/upgrade-instructions/data-type-in-contract/fixtures/postgres-extension-space/before/migrations/snapshots/8fe84ef30e8c9db2239923e644dd230639c7b97965a2d235dcc841806046ae34/contract.d.ts
  • test/integration/test/upgrade-instructions/data-type-in-contract/fixtures/postgres-extension-space/before/migrations/snapshots/8fe84ef30e8c9db2239923e644dd230639c7b97965a2d235dcc841806046ae34/contract.json
  • test/integration/test/upgrade-instructions/data-type-in-contract/fixtures/postgres-extension-space/before/prisma/contract.d.ts
  • test/integration/test/upgrade-instructions/data-type-in-contract/fixtures/postgres-extension-space/before/prisma/contract.json
  • test/integration/test/upgrade-instructions/data-type-in-contract/test-helpers.ts
  • test/integration/test/upgrade-instructions/data-type-values/fixtures/sqlite-project/after/migrations/app/20260101T0000_initial/migration.json
  • test/integration/test/upgrade-instructions/data-type-values/fixtures/sqlite-project/after/migrations/app/20260101T0000_initial/migration.ts
  • test/integration/test/upgrade-instructions/data-type-values/fixtures/sqlite-project/after/migrations/app/refs/head.json
  • test/integration/test/upgrade-instructions/data-type-values/fixtures/sqlite-project/after/migrations/snapshots/87f816322dd1925839d0a5ac49589f22d308c3d3db34a1585a4b25f699735684/contract.d.ts
  • test/integration/test/upgrade-instructions/data-type-values/fixtures/sqlite-project/after/migrations/snapshots/87f816322dd1925839d0a5ac49589f22d308c3d3db34a1585a4b25f699735684/contract.json
  • test/integration/test/upgrade-instructions/data-type-values/fixtures/sqlite-project/after/src/prisma/contract.d.ts
  • test/integration/test/upgrade-instructions/data-type-values/fixtures/sqlite-project/after/src/prisma/contract.json
  • test/integration/test/upgrade-instructions/data-type-values/fixtures/sqlite-project/before/migrations/app/20260101T0000_initial/migration.json
  • test/integration/test/upgrade-instructions/data-type-values/fixtures/sqlite-project/before/migrations/app/20260101T0000_initial/migration.ts
  • test/integration/test/upgrade-instructions/data-type-values/fixtures/sqlite-project/before/migrations/app/refs/head.json
  • test/integration/test/upgrade-instructions/data-type-values/fixtures/sqlite-project/before/migrations/snapshots/85008a1e38a85164c8ad699585433ec7cd2b599eceffbbf7f753923b114e3219/contract.d.ts
  • test/integration/test/upgrade-instructions/data-type-values/fixtures/sqlite-project/before/migrations/snapshots/85008a1e38a85164c8ad699585433ec7cd2b599eceffbbf7f753923b114e3219/contract.json
  • test/integration/test/upgrade-instructions/data-type-values/fixtures/sqlite-project/before/src/prisma/contract.d.ts
  • test/integration/test/upgrade-instructions/data-type-values/fixtures/sqlite-project/before/src/prisma/contract.json
  • test/integration/test/upgrade-instructions/data-type-values/test-helpers.ts
  • test/integration/test/upgrade-instructions/expand-type-aliases/expand-type-aliases.merges.test.ts
  • test/integration/test/upgrade-instructions/expand-type-aliases/expand-type-aliases.test.ts
  • test/integration/test/upgrade-instructions/expand-type-aliases/field-events.test.ts
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixture-generator.ts
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/after/migrations/app/20260101T0000_initial/contract.prisma
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/after/migrations/app/20260101T0000_initial/migration.json
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/after/migrations/app/20260101T0000_initial/migration.ts
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/after/migrations/app/20260101T0000_initial/ops.json
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/after/migrations/app/20260201T0000_add_title/contract.prisma
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/after/migrations/app/20260201T0000_add_title/migration.json
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/after/migrations/app/20260201T0000_add_title/migration.ts
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/after/migrations/app/20260201T0000_add_title/ops.json
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/after/migrations/app/refs/head.json
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/after/migrations/pgvector/refs/head.json
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/after/migrations/snapshots/4a96b488a4ce92b434e5f7d6607b6435c0955f0d36b0018077045787764240e6/contract.d.ts
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/after/migrations/snapshots/4a96b488a4ce92b434e5f7d6607b6435c0955f0d36b0018077045787764240e6/contract.json
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/after/migrations/snapshots/b780ffea90053c47ccc4c522fb690a6f7742e5be20c396b2801e4e9604110369/contract.d.ts
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/after/migrations/snapshots/b780ffea90053c47ccc4c522fb690a6f7742e5be20c396b2801e4e9604110369/contract.json
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/after/migrations/snapshots/f9fe553123fbfef2c6915c522258b03161a755a2ce41757ef560bc17cf4196fe/contract.d.ts
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/after/migrations/snapshots/f9fe553123fbfef2c6915c522258b03161a755a2ce41757ef560bc17cf4196fe/contract.json
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/after/prisma/contract.d.ts
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/after/prisma/contract.json
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/after/prisma/contract.prisma
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/before/migrations/app/20260101T0000_initial/contract.prisma
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/before/migrations/app/20260101T0000_initial/migration.json
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/before/migrations/app/20260101T0000_initial/migration.ts
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/before/migrations/app/20260101T0000_initial/ops.json
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/before/migrations/app/20260201T0000_add_title/contract.prisma
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/before/migrations/app/20260201T0000_add_title/migration.json
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/before/migrations/app/20260201T0000_add_title/migration.ts
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/before/migrations/app/20260201T0000_add_title/ops.json
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/before/migrations/app/refs/head.json
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/before/migrations/pgvector/refs/head.json
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/before/migrations/snapshots/4a96b488a4ce92b434e5f7d6607b6435c0955f0d36b0018077045787764240e6/contract.d.ts
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/before/migrations/snapshots/4a96b488a4ce92b434e5f7d6607b6435c0955f0d36b0018077045787764240e6/contract.json
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/before/migrations/snapshots/b125bc8a23cb005d4a843e746b19417156e64c9104e9199ce1a059dac6f70fbb/contract.d.ts
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/before/migrations/snapshots/b125bc8a23cb005d4a843e746b19417156e64c9104e9199ce1a059dac6f70fbb/contract.json
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/before/migrations/snapshots/eac9a16cf3aae00acba34eeb8f738ba0dab4bc5cf1ed4bc76822727c30fb937f/contract.d.ts
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/before/migrations/snapshots/eac9a16cf3aae00acba34eeb8f738ba0dab4bc5cf1ed4bc76822727c30fb937f/contract.json
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/before/prisma/contract.d.ts
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/before/prisma/contract.json
  • test/integration/test/upgrade-instructions/expand-type-aliases/fixtures/before/prisma/contract.prisma
  • test/integration/test/upgrade-instructions/expand-type-aliases/test-helpers.ts
  • upgrade-instructions/pending/expand-type-aliases/app/instructions.md
  • upgrade-instructions/pending/expand-type-aliases/app/scripts/expand-type-aliases/expand-type-aliases.ts
  • upgrade-instructions/pending/expand-type-aliases/extension/instructions.md
  • upgrade-instructions/pending/expand-type-aliases/extension/scripts/expand-type-aliases/expand-type-aliases.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

@prisma/orm-extension-arktype-json

npm i https://pkg.pr.new/@prisma/orm-extension-arktype-json@30819

@prisma/orm-extension-middleware-cache

npm i https://pkg.pr.new/@prisma/orm-extension-middleware-cache@30819

@prisma/orm-extension-paradedb

npm i https://pkg.pr.new/@prisma/orm-extension-paradedb@30819

@prisma/orm-extension-pgvector

npm i https://pkg.pr.new/@prisma/orm-extension-pgvector@30819

@prisma/orm-extension-postgis

npm i https://pkg.pr.new/@prisma/orm-extension-postgis@30819

@prisma/orm-extension-supabase

npm i https://pkg.pr.new/@prisma/orm-extension-supabase@30819

@prisma/orm-family-mongo

npm i https://pkg.pr.new/@prisma/orm-family-mongo@30819

@prisma/orm-family-sql

npm i https://pkg.pr.new/@prisma/orm-family-sql@30819

@prisma/orm-framework

npm i https://pkg.pr.new/@prisma/orm-framework@30819

@prisma/orm-mongo

npm i https://pkg.pr.new/@prisma/orm-mongo@30819

@prisma/orm-postgres

npm i https://pkg.pr.new/@prisma/orm-postgres@30819

@prisma/orm-sqlite

npm i https://pkg.pr.new/@prisma/orm-sqlite@30819

@prisma/orm-target-mongo

npm i https://pkg.pr.new/@prisma/orm-target-mongo@30819

@prisma/orm-target-postgres

npm i https://pkg.pr.new/@prisma/orm-target-postgres@30819

@prisma/orm-target-sqlite

npm i https://pkg.pr.new/@prisma/orm-target-sqlite@30819

@prisma/orm-toolchain

npm i https://pkg.pr.new/@prisma/orm-toolchain@30819

commit: c7e748f

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
postgres / no-emit 261.71 KB (+0.25% 🔺)
postgres / emit 229.31 KB (-0.38% 🔽)
mongo / no-emit 212.12 KB (+0.48% 🔺)
mongo / emit 182.14 KB (0%)
cf-worker / no-emit 324.55 KB (+0.22% 🔺)
cf-worker / emit 288.37 KB (-0.31% 🔽)

@wmadden-electric wmadden-electric changed the title TML-3607: A type alias is expanded into each column, and the targets contribute temporal.CreatedAt and temporal.UpdatedAt TML-3607: Type aliases can set @onCreate and @onUpdate, and the contract stores the real column type instead of the alias name Oct 21, 2026
@wmadden
wmadden added this pull request to the merge queue Oct 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 21, 2026
…s to print as its type constructor, with no types block

contract print writes no types {} block now that contracts store no alias, so the raw-columns and extension-types round-trip tests assert the expanded column instead of the alias declaration.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
… the migration tooling wrote, so the data-type-in-contract script's output matches the after tree

Biome sorted the imports of the before migration.ts by snapshot hash when the fixture's hashes changed. The script keeps import order, and the new hashes sort the other way, so its output no longer matched the sorted after tree. Biome no longer organizes imports in the migration.ts files of upgrade fixtures, and the before file is back in Start, End order.

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
@wmadden
wmadden enabled auto-merge October 21, 2026 16:21
@wmadden
wmadden added this pull request to the merge queue Oct 21, 2026
@wmadden
wmadden removed this pull request from the merge queue due to a manual request Oct 21, 2026
@wmadden
wmadden added this pull request to the merge queue Oct 22, 2026
Merged via the queue into main with commit b8421eb Oct 22, 2026
23 of 25 checks passed
@wmadden
wmadden deleted the tml-3607-alias-expansion branch October 22, 2026 06:12
opensource-fork-sync Bot pushed a commit to cla7aye15I4nd/opensource-prisma__orm that referenced this pull request Oct 27, 2026
…constructor or type alias that stores the same contract (prisma#30845)

## At a glance

Before this PR, a Prisma 8 schema could write a field with a *field
preset*, a single call that set the column type, the identity and the
generated values at once:

```prisma
model User {
  id        id.ulid()
  updatedAt temporal.updatedAt()
  posts     Post[]
}

model Post {
  id       id.ulid()
  authorId ulid()
  author   User @relation(fields: [authorId], references: [id])
}
```

After this PR, field presets no longer exist. The same fields are
written with the type constructors, type aliases and attributes the rest
of a schema already uses:

```prisma
model User {
  id        Ulid               @id @onCreate(ulid())
  updatedAt temporal.UpdatedAt
  posts     Post[]
}

model Post {
  id       Ulid @id @onCreate(ulid())
  authorId Ulid
  author   User @relation(fields: [authorId], references: [id])
}
```

`Ulid` is a new type alias for `Char(26)`, the column a ULID is stored
in. The id and the foreign key use the same alias, so nobody writes the
length 26. The new form stores exactly the same contract, so the storage
and execution hashes do not change. A user only rewrites the calls;
nothing is re-emitted, signed again or migrated.

The same holds in TypeScript: `field.id.ulid()` becomes
`field.column(type.Ulid()).id().onCreate(gen.ulid())`.

## The decision

ADR 275 decided to remove field presets. This PR, the third and last for
TML-3607, carries that out:

- **Earlier PRs:** prisma#30780 made generated values attributes (`@onCreate`,
`@onUpdate`), and prisma#30819 let type aliases carry those attributes, adding
the ready-made aliases `temporal.CreatedAt` and `temporal.UpdatedAt`.
- **This PR:** with replacements in place, it removes the presets
themselves, in PSL, in both TypeScript builders (SQL and MongoDB), and
in the framework.

Presets were a second way to write what attributes already say, with
their own argument forms such as the bare `now` in `onCreate: now`.
Their authors also paired a column codec with a generator by hand, which
once wrote a JavaScript `Date` into a text column. Attributes and
aliases cover the same ground, and any user can write them.

## A type alias for each generated identifier

Identifier presets were the main reason presets existed: a user wrote
`id.ulid()` and never needed to know a ULID is stored in `Char(26)`. So
this PR adds a type alias for each identifier column. ADR 310 explains
the design.

| Alias | Stands for | A generating field writes |
|---|---|---|
| `UuidString` | `Char(36)` | `@onCreate(uuid())` or
`@onCreate(uuid(7))` |
| `Ulid` | `Char(26)` | `@onCreate(ulid())` |
| `Nanoid` | `Char(21)` | `@onCreate(nanoid())` |
| `Cuid2` | `Char(24)` | `@onCreate(cuid(2))` |
| `Ksuid` | `Char(27)` | `@onCreate(ksuid())` |

- **The alias names the column only.** A foreign key holds a copy of the
id, so it needs the same column and must not generate a value. The id
field writes `@id` and its generator itself.
- **Where the names live.** The SQL family provides them as `sql.Ulid`
and so on, on Postgres, SQLite and MySQL. Postgres also has them as
top-level names, like its other column types `Char` and `Uuid`. In
TypeScript they are `type.Ulid()` and `type.sql.Ulid()`.
- **A one-word id is a mixin the user writes:** `model mixin UlidId { id
Ulid @id @onCreate(ulid()) }`, then `+UlidId`. The upgrade guide shows
it, with the TypeScript constant `const UlidId =
field.column(type.Ulid()).id().onCreate(gen.ulid());`.
- **Native UUIDs need no alias.** On Postgres, `Uuid @id
@onCreate(uuid(7))` is the recommended form, and the `prisma init`
Postgres TypeScript starter now uses it.

## What a user sees

**PSL refuses every preset with its exact rewrite.** For example:

```text
PSL_UNRESOLVED_REFERENCE: id.ulid() was a field preset, and Prisma 8 removed field presets. Write Ulid @id @onCreate(ulid()).
```

On SQLite the rewrite is `sql.Ulid @id @onCreate(ulid())`. On Postgres,
a schema that declares its own `model Ulid` gets the `sql.Ulid` form,
because its model hides the top-level name.

**The refusal is shown in a schema with relations.** Before, a field
whose type did not resolve was dropped, and the contract build then
threw a relation error, such as `CONTRACT.RELATION_INVALID: Relation
"User.posts" joins on column "id" ...`, which hid the real diagnostic.
Now field resolution records every field it drops, and the build stops
before it runs. The user sees the refusal with its rewrite. This applies
to any unresolved field type, not only presets.

**An unknown bare type name suggests the name in a namespace.** On
SQLite, `Ulid` gives `Cannot find type "Ulid". Did you mean sql.Ulid?`.

**TypeScript refuses a preset twice.** It is a compile error, because
the helper no longer exists. If a contract still calls one at run time,
for example through `contract emit` before `tsc`, the read throws
`CONTRACT.FIELD_HELPER_UNKNOWN` with the same rewrite. Before this, the
user got `Cannot read properties of undefined`. The run-time check
answers only the removed preset names and adds nothing to the public
types.

**An extension that still contributes presets is refused.** A pack with
an `authoring.field` namespace fails with
`CONTRACT.PACK_CONTRIBUTION_INVALID`, and the message says to contribute
a type alias instead.

**A new SQL type constructor, `sql.Char(length)`, on every SQL target.**
SQLite stored its identifier presets as a fixed-length text column but
had no way to write that type. Now `sql.Char(36)` works on Postgres,
SQLite and MySQL.

**The upgrade guide** is
`upgrade-instructions/pending/remove-field-presets/`, for apps and for
extension authors. It has a before-and-after table for every preset in
every target and both TypeScript builders. It opens by saying which
advice from the 8.0.0-rc.19 guide no longer holds.

## What was removed

- The `fieldPreset` descriptor kind, the `authoring.field` namespace,
and every preset map in the SQL family, Postgres, SQLite and MongoDB.
- `field.generated(...)` and the `@internal/ids` helpers that bundled a
column type with a generator.
- The `option`, `number` and `object` argument kinds, the `select`
template, and the two text parsers only those used. Only the `value`
argument kind remains.
- The preset branches of the language server.
- The `projects/remove-field-presets/` folder, now that the project is
done. Its long-lived content moved into ADR 275's amendment, ADR 310 and
the Data Contract doc.

## How it was checked

- **Same contracts.** A parity test runs every preset (on Postgres,
SQLite and MongoDB) through the real emit pipeline and checks that its
replacement stores the same contract. For PSL, it takes the rewrite from
the refusal message itself and checks that. For TypeScript, a sibling
test does the same for every rewrite. Another test checks that a key and
a foreign key typed by each alias emit the same contract as `Char(n)`.
`fixtures:check` shows no contract change across the repository.
- **Real upgrades by hand.** Projects that used presets, on Postgres and
MongoDB in PSL and TypeScript, were upgraded by following the guide, and
came out with the old hashes. Manual QA of the aliases ran the built CLI
on Postgres and SQLite projects: each alias in every form, the refusals
with and without relations, the length check, TypeScript type checking,
`prisma init`, `contract print`, and every example in the guide.
- **New projects.** Each `prisma init` starter writes no preset, and a
test pins its contract hashes. The Postgres TypeScript starter's storage
hash changes, because its ids move to the native `uuid` column. This
affects only new projects.
- **Review.** Six rounds of `/drive-code-review` and two rounds of
manual QA; every in-scope finding is fixed.
- **Checks.** Every CI lint step and coverage pass, along with all
related integration files, run one at a time.
- **Examples.** Merging main's renamed Postgres date and time types
(`TimestamptzTemporal`, `TimestampTemporal`) broke two files in
`examples/prisma-8-demo`. They are updated with the rename only.

The framework vocabulary check counts SQL and MongoDB words inside
`packages/1-framework`. This PR lowers that count from 236 to 218. It
adds two counted lines: the `prisma init` templates now write
`field.column(...)`. Those templates were already SQL code inside the
framework CLI. Moving them out needs a new framework interface, which is
TML-3702.

## Follow-ups

- **TML-3702:** move the `prisma init` templates out of the framework
CLI.
- **TML-3705:** a contributed type alias cannot take arguments, so
`temporal.UpdatedAt` has no form with a precision, and a nanoid of
another size has no alias.
- **TML-3706:** the MongoDB TypeScript builder has no `type.*` helpers,
so it cannot use contributed aliases. MongoDB TypeScript users write
`field.date().onCreate(gen.now()).onUpdate(gen.now())`.
- **TML-3707:** generator descriptors share a structure with the default
functions, which leaves five empty registries.
- **TML-3751:** the rule that decides whether a rewrite applies on a
target is written twice, once for PSL and once in the SQL TypeScript
package, because that package cannot import the PSL parser.
- **TML-3752:** a model named like a type, such as `model Ulid { id Ulid
@id }`, fails with an error that does not mention the name clash.
- **TML-3753:** a TypeScript contract that was never type-checked and
uses a name its target lacks, such as `type.Ulid()` on SQLite, fails
with a raw `type.Ulid is not a function`.
- **TML-3754:** the "Did you mean" suggestion lives in the SQL family's
unresolved-type hook, so MongoDB schemas do not get it, and it does not
cover calls such as `Foo(3)`.

## Alternatives considered

- **Keep presets as a shorthand beside attributes.** Not chosen: two
ways to write one thing, and presets were available to packs only, not
users.
- **An identifier alias that carries the generator too.** Not chosen: a
foreign key needs the same column without a generator, so each format
would need two aliases. ADR 310 covers this and the naming alternatives.
- **TypeScript stubs that throw when called.** Not chosen: they would
keep every preset name in the public types. The run-time check answers
removed names only, through the object, and the types stay clean.
- **Move the `prisma init` template text into files the vocabulary check
skips.** Not chosen: that would hide the lines from the check without
moving the SQL code out of the framework. TML-3702 tracks the real move.

Closes TML-3607.

Agent: frankenstein-64

---------

Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants