diff --git a/packages/1-framework/3-tooling/cli/src/commands/init/hygiene-gitignore.ts b/packages/1-framework/3-tooling/cli/src/commands/init/hygiene-gitignore.ts index cdb3c4636f17..d87a6a5c0d2d 100644 --- a/packages/1-framework/3-tooling/cli/src/commands/init/hygiene-gitignore.ts +++ b/packages/1-framework/3-tooling/cli/src/commands/init/hygiene-gitignore.ts @@ -1,5 +1,5 @@ /** - * The minimal `.gitignore` lines a Prisma Next scaffold needs (FR3.3). + * The minimal `.gitignore` lines a Prisma ORM scaffold needs (FR3.3). * Order matches what Node tooling typically writes today. * * `node_modules/` first because it's the byte-largest miss; `dist/` diff --git a/packages/1-framework/3-tooling/cli/src/commands/init/templates/quick-reference-mongo.md b/packages/1-framework/3-tooling/cli/src/commands/init/templates/quick-reference-mongo.md index fc769308e403..964b91355dbb 100644 --- a/packages/1-framework/3-tooling/cli/src/commands/init/templates/quick-reference-mongo.md +++ b/packages/1-framework/3-tooling/cli/src/commands/init/templates/quick-reference-mongo.md @@ -1,8 +1,8 @@ -# Welcome to Prisma Next! +# Welcome to Prisma ORM! -Prisma Next lets you query your database in simple, easy-to-read TypeScript. Define what your data looks like, and Prisma Next gives you a fully typed client — with autocomplete for every collection, field, and relation. +Prisma ORM lets you query your database in simple, easy-to-read TypeScript. Define what your data looks like, and Prisma ORM gives you a fully typed client — with autocomplete for every collection, field, and relation. -This project is set up for MongoDB. Prisma Next also supports other databases. +This project is set up for MongoDB. Prisma ORM also supports other databases. {{requirements}} @@ -34,7 +34,7 @@ Your contract has two companion files in the same directory: Commit both files to git. When you change your contract, run `{{pkgRun}} contract emit` to update them. -If you use a framework like Next.js or Vite, the Prisma Next plugin will do this for you automatically. +If you use a framework like Next.js or Vite, the Prisma ORM plugin will do this for you automatically. ## Configuration @@ -97,14 +97,14 @@ Multi-document transactions and change streams require MongoDB to run as a **rep - **`mongodb-memory-server`:** use `MongoMemoryReplSet` instead of `MongoMemoryServer` in tests. - **MongoDB Atlas:** every Atlas cluster is already a replica set. -The transaction API (`db.transaction(...)`) is on the roadmap and tracked under [TML-2313](https://linear.app/prisma-company/issue/TML-2313/mongo-dev-replica-set-story-is-missing-transactions-change-streams). Prisma Next's Mongo facade does not expose it yet — until that ticket lands, drive transactions yourself with a raw `MongoClient` using the escape hatch in the next section. +The transaction API (`db.transaction(...)`) is on the roadmap and tracked under [TML-2313](https://linear.app/prisma-company/issue/TML-2313/mongo-dev-replica-set-story-is-missing-transactions-change-streams). Prisma ORM's Mongo facade does not expose it yet — until that ticket lands, drive transactions yourself with a raw `MongoClient` using the escape hatch in the next section. ## Escape hatches The ORM covers the common cases. For the rest, two escape hatches are designed in: - **Typed raw aggregations — `db.query`.** The facade exposes `db.query`, a typed builder for aggregation pipelines that runs through the same runtime + middleware + codec stack as `db.orm`. Reach for it when the ORM can't express a `$lookup`/`$facet`/`$graphLookup`/window-function pipeline. -- **Direct `mongodb` driver control — `mongoClient` binding.** Construct your own `MongoClient` and pass it to `mongo({ mongoClient, dbName, contractJson })`. Your code keeps the `MongoClient` reference and uses it directly (transactions, change streams, sessions, anything Prisma Next doesn't surface yet); the same `db` object continues to give you the typed ORM. +- **Direct `mongodb` driver control — `mongoClient` binding.** Construct your own `MongoClient` and pass it to `mongo({ mongoClient, dbName, contractJson })`. Your code keeps the `MongoClient` reference and uses it directly (transactions, change streams, sessions, anything Prisma ORM doesn't surface yet); the same `db` object continues to give you the typed ORM. `db.runtime()` is **not** the escape hatch — it returns the internal executor (`MongoRuntime`), not a `mongodb` `MongoClient` or `Db`. Use `db.query` for raw aggregations and the `mongoClient` binding for direct driver control. @@ -113,5 +113,5 @@ The ORM covers the common cases. For the rest, two escape hatches are designed i If this project lives inside a pnpm workspace, a few things are worth knowing: - **Catalogs.** When the workspace's `pnpm-workspace.yaml` defines a `catalogs` entry for `prisma` or `{{pkg}}`, pnpm uses the catalog version everywhere — `init` does too. If you wanted the published `latest` instead, update or remove the catalog entry, then re-run `pnpm install`. -- **`pnpm dlx`.** `pnpm dlx prisma@next orm init …` works in any directory. Inside a workspace, pnpm still resolves dependencies through the workspace's catalog/overrides rather than the registry; expect the installed Prisma Next packages to reflect the workspace's catalog rather than `latest`. -- **`pnpm` → `npm` fallback.** If `pnpm` ever fails to install Prisma Next with a `workspace:*` or `catalog:` resolution error (a leak in a published artefact), `init` falls back to `npm install` and surfaces a warning. Once the offending package republishes a clean version you can switch back with `pnpm install`. +- **`pnpm dlx`.** `pnpm dlx prisma@next orm init …` works in any directory. Inside a workspace, pnpm still resolves dependencies through the workspace's catalog/overrides rather than the registry; expect the installed Prisma ORM packages to reflect the workspace's catalog rather than `latest`. +- **`pnpm` → `npm` fallback.** If `pnpm` ever fails to install Prisma ORM with a `workspace:*` or `catalog:` resolution error (a leak in a published artefact), `init` falls back to `npm install` and surfaces a warning. Once the offending package republishes a clean version you can switch back with `pnpm install`. diff --git a/packages/1-framework/3-tooling/cli/src/commands/init/templates/quick-reference-postgres.md b/packages/1-framework/3-tooling/cli/src/commands/init/templates/quick-reference-postgres.md index bd1f866ddf10..14f98620d6c5 100644 --- a/packages/1-framework/3-tooling/cli/src/commands/init/templates/quick-reference-postgres.md +++ b/packages/1-framework/3-tooling/cli/src/commands/init/templates/quick-reference-postgres.md @@ -1,8 +1,8 @@ -# Welcome to Prisma Next! +# Welcome to Prisma ORM! -Prisma Next lets you query your database in simple, easy-to-read TypeScript. Define what your data looks like, and Prisma Next gives you a fully typed client — with autocomplete for every table, column, and relation. +Prisma ORM lets you query your database in simple, easy-to-read TypeScript. Define what your data looks like, and Prisma ORM gives you a fully typed client — with autocomplete for every table, column, and relation. -This project is set up for PostgreSQL. Prisma Next also supports other databases. +This project is set up for PostgreSQL. Prisma ORM also supports other databases. {{requirements}} @@ -32,7 +32,7 @@ Your contract has two companion files in the same directory: Commit both files to git. When you change your contract, run `{{pkgRun}} contract emit` to update them. -If you use a framework like Next.js or Vite, the Prisma Next plugin will do this for you automatically. +If you use a framework like Next.js or Vite, the Prisma ORM plugin will do this for you automatically. ## Configuration @@ -92,5 +92,5 @@ You can customize how your environment variables are loaded by changing or remov If this project lives inside a pnpm workspace, a few things are worth knowing: - **Catalogs.** When the workspace's `pnpm-workspace.yaml` defines a `catalogs` entry for `prisma` or `{{pkg}}`, pnpm uses the catalog version everywhere — `init` does too. If you wanted the published `latest` instead, update or remove the catalog entry, then re-run `pnpm install`. -- **`pnpm dlx`.** `pnpm dlx prisma@next orm init …` works in any directory. Inside a workspace, pnpm still resolves dependencies through the workspace's catalog/overrides rather than the registry; expect the installed Prisma Next packages to reflect the workspace's catalog rather than `latest`. -- **`pnpm` → `npm` fallback.** If `pnpm` ever fails to install Prisma Next with a `workspace:*` or `catalog:` resolution error (a leak in a published artefact), `init` falls back to `npm install` and surfaces a warning. Once the offending package republishes a clean version you can switch back with `pnpm install`. +- **`pnpm dlx`.** `pnpm dlx prisma@next orm init …` works in any directory. Inside a workspace, pnpm still resolves dependencies through the workspace's catalog/overrides rather than the registry; expect the installed Prisma ORM packages to reflect the workspace's catalog rather than `latest`. +- **`pnpm` → `npm` fallback.** If `pnpm` ever fails to install Prisma ORM with a `workspace:*` or `catalog:` resolution error (a leak in a published artefact), `init` falls back to `npm install` and surfaces a warning. Once the offending package republishes a clean version you can switch back with `pnpm install`. diff --git a/packages/1-framework/3-tooling/cli/src/commands/init/templates/readme-mongo.md b/packages/1-framework/3-tooling/cli/src/commands/init/templates/readme-mongo.md index dab43022425c..6496cdc89560 100644 --- a/packages/1-framework/3-tooling/cli/src/commands/init/templates/readme-mongo.md +++ b/packages/1-framework/3-tooling/cli/src/commands/init/templates/readme-mongo.md @@ -9,7 +9,7 @@ Generated by `prisma orm init` with the Minimal template. ## Available scripts -- `{{runDev}}` — run the Prisma Next sample script +- `{{runDev}}` — run the Prisma ORM sample script ### Database and migrations @@ -21,15 +21,15 @@ Generated by `prisma orm init` with the Minimal template. - `{{runMigrate}}` — apply the planned MongoDB migration - `{{runDbSeed}}` — insert sample users manually -## Prisma Next +## Prisma ORM -Prisma Next setup is scaffolded in: +Prisma ORM setup is scaffolded in: - `{{contractPath}}` - `prisma.config.ts` - `prisma/db.ts` - `src/lib/prisma.ts` -For provider-specific Prisma Next reference docs, see `prisma-next.md`. Prisma Next skills live in the upstream `skills/` directory: https://github.com/prisma/prisma/tree/main/skills. +For provider-specific Prisma ORM reference docs, see `prisma-next.md`. Prisma ORM skills live in the upstream `skills/` directory: https://github.com/prisma/prisma/tree/main/skills. -Node-based Prisma Next projects expect Node.js 24 LTS or newer. +Node-based Prisma ORM projects expect Node.js 24 LTS or newer. diff --git a/packages/1-framework/3-tooling/cli/src/commands/init/templates/readme-postgres.md b/packages/1-framework/3-tooling/cli/src/commands/init/templates/readme-postgres.md index 1d5cd787b303..55b875a8ea3d 100644 --- a/packages/1-framework/3-tooling/cli/src/commands/init/templates/readme-postgres.md +++ b/packages/1-framework/3-tooling/cli/src/commands/init/templates/readme-postgres.md @@ -9,7 +9,7 @@ Generated by `prisma orm init` with the Minimal template. ## Available scripts -- `{{runDev}}` — run the Prisma Next sample script +- `{{runDev}}` — run the Prisma ORM sample script ### Database and migrations @@ -20,15 +20,15 @@ Generated by `prisma orm init` with the Minimal template. - `{{runMigrate}}` — apply a planned migration - `{{runDbSeed}}` — insert sample users manually (run after `db:init`) -## Prisma Next +## Prisma ORM -Prisma Next setup is scaffolded in: +Prisma ORM setup is scaffolded in: - `{{contractPath}}` - `prisma.config.ts` - `prisma/db.ts` - `src/lib/prisma.ts` -For provider-specific Prisma Next reference docs, see `prisma-next.md`. Prisma Next skills live in the upstream `skills/` directory: https://github.com/prisma/prisma/tree/main/skills. +For provider-specific Prisma ORM reference docs, see `prisma-next.md`. Prisma ORM skills live in the upstream `skills/` directory: https://github.com/prisma/prisma/tree/main/skills. -Node-based Prisma Next projects expect Node.js 24 LTS or newer. +Node-based Prisma ORM projects expect Node.js 24 LTS or newer. diff --git a/packages/1-framework/3-tooling/cli/src/control-api/client.ts b/packages/1-framework/3-tooling/cli/src/control-api/client.ts index 1a28bb930321..b61d5dbbee06 100644 --- a/packages/1-framework/3-tooling/cli/src/control-api/client.ts +++ b/packages/1-framework/3-tooling/cli/src/control-api/client.ts @@ -57,7 +57,7 @@ import type { } from './types'; /** - * Creates a programmatic control client for Prisma Next operations. + * Creates a programmatic control client for Prisma ORM operations. * * The client accepts framework component descriptors at creation time, * manages driver lifecycle via connect()/close(), and exposes domain diff --git a/packages/1-framework/3-tooling/cli/src/control-api/operations/migrate.ts b/packages/1-framework/3-tooling/cli/src/control-api/operations/migrate.ts index 34578b795262..d9d6df5647d7 100644 --- a/packages/1-framework/3-tooling/cli/src/control-api/operations/migrate.ts +++ b/packages/1-framework/3-tooling/cli/src/control-api/operations/migrate.ts @@ -413,7 +413,7 @@ export function planSpacePath({ // migration packages at all. Advancing the marker without migrations // (the db-init aggregate planner's declared-state strategy, mirrored // here) is valid exclusively when every element the space declares is - // externally managed — nothing Prisma Next owns exists in such a space + // externally managed — nothing Prisma ORM owns exists in such a space // (e.g. Supabase's auth/storage), so its declared state needs no // migration to be true, and there is no command that could author an // edge for it. A space that declares a managed element but ships no diff --git a/packages/1-framework/3-tooling/cli/src/control-api/types.ts b/packages/1-framework/3-tooling/cli/src/control-api/types.ts index 091700537f4e..fef9cfeca4ed 100644 --- a/packages/1-framework/3-tooling/cli/src/control-api/types.ts +++ b/packages/1-framework/3-tooling/cli/src/control-api/types.ts @@ -841,7 +841,7 @@ export interface ContractEmitResult { // ============================================================================ /** - * Programmatic control client for Prisma Next operations. + * Programmatic control client for Prisma ORM operations. * * Lifecycle: `connect(connection)` before operations, `close()` when done. * Both `init()` and `connect()` are auto-called by operations if needed, diff --git a/packages/1-framework/3-tooling/cli/src/exports/control-api.ts b/packages/1-framework/3-tooling/cli/src/exports/control-api.ts index 7b88d5021c87..3752c11eaed6 100644 --- a/packages/1-framework/3-tooling/cli/src/exports/control-api.ts +++ b/packages/1-framework/3-tooling/cli/src/exports/control-api.ts @@ -1,5 +1,5 @@ /** - * Programmatic Control API for Prisma Next. + * Programmatic Control API for Prisma ORM. * * This module exports the control client factory and types for programmatic * access to control-plane operations without using the CLI. diff --git a/packages/1-framework/3-tooling/cli/src/orm/config-section.ts b/packages/1-framework/3-tooling/cli/src/orm/config-section.ts index f41b11849437..cb0d885eba06 100644 --- a/packages/1-framework/3-tooling/cli/src/orm/config-section.ts +++ b/packages/1-framework/3-tooling/cli/src/orm/config-section.ts @@ -40,7 +40,7 @@ function sectionAbsentDiagnostic(): Diagnostic { return { code: 'CONFIG.FILE_NOT_FOUND', severity: 'error', - summary: 'No Prisma Next configuration was loaded', + summary: 'No Prisma ORM configuration was loaded', why: `The ${ORM_CONFIG_SECTION_NAME} config section is absent, so prisma.config.ts was never evaluated.`, nextActions: [MISSING_CONFIG_ACTION], }; @@ -50,7 +50,7 @@ function notAnObjectDiagnostic(): Diagnostic { return { code: 'CONFIG.VALIDATION_FAILED', severity: 'error', - summary: 'Prisma Next configuration must be an object', + summary: 'Prisma ORM configuration must be an object', why: `The ${ORM_CONFIG_SECTION_NAME} config section is not an object, so no section can be read from it.`, nextActions: [ { kind: 'edit-file', label: 'Export a configuration object from prisma.config.ts' }, @@ -62,7 +62,7 @@ function unreadableDiagnostic(error: unknown): Diagnostic { return { code: 'CONFIG.VALIDATION_FAILED', severity: 'error', - summary: 'Prisma Next configuration could not be inspected', + summary: 'Prisma ORM configuration could not be inspected', why: error instanceof Error ? error.message : String(error), nextActions: [ { diff --git a/packages/1-framework/3-tooling/cli/src/orm/define-command.ts b/packages/1-framework/3-tooling/cli/src/orm/define-command.ts index 368cf67f8bdc..391292999705 100644 --- a/packages/1-framework/3-tooling/cli/src/orm/define-command.ts +++ b/packages/1-framework/3-tooling/cli/src/orm/define-command.ts @@ -27,7 +27,7 @@ import { normalizeError } from './normalize-error'; * * An `InternalError` is the one thing this boundary does not convert. Its own contract says never * to catch it outside the outermost boundary: it means an invariant broke, which is a bug in - * Prisma Next rather than something the user did. Re-throwing lets the engine settle it as a bug + * Prisma ORM rather than something the user did. Re-throwing lets the engine settle it as a bug * at exit 1, where converting it would report the same number as a bad connection string. */ function isRecord(value: unknown): value is Record { diff --git a/packages/1-framework/3-tooling/cli/src/orm/init-packages.ts b/packages/1-framework/3-tooling/cli/src/orm/init-packages.ts index 20b174bb0c44..f8297ee2f009 100644 --- a/packages/1-framework/3-tooling/cli/src/orm/init-packages.ts +++ b/packages/1-framework/3-tooling/cli/src/orm/init-packages.ts @@ -44,7 +44,7 @@ function pnpmLeakedASpecifier(failure: CliStructuredError): boolean { function fallbackWarning(failure: CliStructuredError): string { const firstLine = redactSecrets(metaString(failure, 'stderrTail')).trim().split('\n')[0] ?? ''; return [ - 'pnpm could not install: a published Prisma Next dependency leaked a `workspace:*` or `catalog:` specifier.', + 'pnpm could not install: a published Prisma ORM dependency leaked a `workspace:*` or `catalog:` specifier.', 'Falling back to npm so init can complete.', firstLine === '' ? '' : ` pnpm error: ${firstLine}`, 'Both installs ran under npm, which writes a package-lock.json beside the pnpm lockfile — delete whichever of the two you do not want to keep.', diff --git a/packages/1-framework/3-tooling/cli/src/orm/init-scaffold.ts b/packages/1-framework/3-tooling/cli/src/orm/init-scaffold.ts index ff9ffeef962f..c30568c7737b 100644 --- a/packages/1-framework/3-tooling/cli/src/orm/init-scaffold.ts +++ b/packages/1-framework/3-tooling/cli/src/orm/init-scaffold.ts @@ -51,7 +51,7 @@ const ENV_EXAMPLE_FILE = '.env.example'; * one of these is the destructive act consent is asked for. * * `.env.example` is written the same way but deliberately left out: it is a - * conventional filename in projects that have never seen Prisma Next, and a + * conventional filename in projects that have never seen Prisma ORM, and a * consent token demanded for it would fire on first runs. The scaffold warns * when it replaces one instead. */ @@ -201,7 +201,7 @@ function planScaffold(ctx: { if (existsSync(join(cwd, ENV_EXAMPLE_FILE))) { warnings.push( - `${ENV_EXAMPLE_FILE} already existed and was replaced with the Prisma Next template.`, + `${ENV_EXAMPLE_FILE} already existed and was replaced with the Prisma ORM template.`, ); } diff --git a/packages/1-framework/3-tooling/cli/src/orm/init.ts b/packages/1-framework/3-tooling/cli/src/orm/init.ts index 594ca06e3b30..4be9a78fa422 100644 --- a/packages/1-framework/3-tooling/cli/src/orm/init.ts +++ b/packages/1-framework/3-tooling/cli/src/orm/init.ts @@ -65,7 +65,7 @@ export interface InitCommandDependencies { export const createInitCommand = (injected: InitCommandDependencies) => defineOrmCommand({ help: { - summary: 'Initialize a new Prisma Next project', + summary: 'Initialize a new Prisma ORM project', description: 'Scaffolds config, schema, and runtime files, installs dependencies,\n' + 'and emits the contract. Gets you from zero to typed queries in one step.\n' + @@ -188,7 +188,7 @@ export const createInitCommand = (injected: InitCommandDependencies) => { why: `The success document failed schema validation: ${String(validated)}`, nextActions: [ - chooseAction('This is a bug in Prisma Next. Please report it with `-v` output.'), + chooseAction('This is a bug in Prisma ORM. Please report it with `-v` output.'), ], docsUrl: docsUrlFor('CLI.INIT_INVALID_OUTPUT_DOCUMENT'), }, diff --git a/packages/1-framework/3-tooling/cli/src/orm/load-config.ts b/packages/1-framework/3-tooling/cli/src/orm/load-config.ts index fc9037ed33c3..e8221f2a7b50 100644 --- a/packages/1-framework/3-tooling/cli/src/orm/load-config.ts +++ b/packages/1-framework/3-tooling/cli/src/orm/load-config.ts @@ -20,7 +20,7 @@ export interface LoadOrmConfigOptions { * The engine ships its own synchronous loader, but the bin owns the load: the * ORM's c12 loader evaluates the module asynchronously and finalizes paths * against the config file's own directory. It reads the same shape the engine - * does — defineConfig from `@prisma/cli-engine` with the whole Prisma Next + * does — defineConfig from `@prisma/cli-engine` with the whole Prisma ORM * configuration nested as the single `orm` section. * * Only failures that prevent evaluation entirely are diagnostics here, and diff --git a/packages/1-framework/3-tooling/cli/src/orm/lsp.ts b/packages/1-framework/3-tooling/cli/src/orm/lsp.ts index 7c7f397e4f36..e35d6e820a06 100644 --- a/packages/1-framework/3-tooling/cli/src/orm/lsp.ts +++ b/packages/1-framework/3-tooling/cli/src/orm/lsp.ts @@ -16,11 +16,11 @@ function signalExitCode(reason: unknown): number { export const lspCommand = defineServerCommand({ help: { - summary: 'Start the Prisma Next language server', + summary: 'Start the Prisma ORM language server', description: 'Launches a Language Server Protocol server that publishes PSL parse diagnostics\n' + 'and handles whole-document PSL formatting for the schema inputs declared in\n' + - 'your config (contract.source.inputs). Formatting uses the Prisma Next PSL\n' + + 'your config (contract.source.inputs). Formatting uses the Prisma ORM PSL\n' + 'formatter and the formatter block from the project config.\n' + 'Communicates over stdio; intended to be spawned by an\n' + 'editor, not run interactively. The server keeps running until the editor client\n' + diff --git a/packages/1-framework/3-tooling/cli/src/orm/telemetry/reporting.ts b/packages/1-framework/3-tooling/cli/src/orm/telemetry/reporting.ts index 4b9af54f2a11..053615bc7bf9 100644 --- a/packages/1-framework/3-tooling/cli/src/orm/telemetry/reporting.ts +++ b/packages/1-framework/3-tooling/cli/src/orm/telemetry/reporting.ts @@ -25,7 +25,7 @@ function senderPath(): string { function firstRunNotice(configPath: string): string { return [ - 'Prisma Next collects anonymous CLI usage data, enabled by default.', + 'Prisma ORM collects anonymous CLI usage data, enabled by default.', "What's collected and why: https://prisma-next.dev/docs/cli/telemetry.", 'Opt out: run "prisma telemetry disable", set DO_NOT_TRACK=1 or', `PRISMA_NEXT_DISABLE_TELEMETRY=1, or set "enableTelemetry": false in ${configPath}.`, diff --git a/packages/1-framework/3-tooling/cli/test/commands/init/__snapshots__/templates.test.ts.snap b/packages/1-framework/3-tooling/cli/test/commands/init/__snapshots__/templates.test.ts.snap index fe19d86975fb..b6bf7bc5b910 100644 --- a/packages/1-framework/3-tooling/cli/test/commands/init/__snapshots__/templates.test.ts.snap +++ b/packages/1-framework/3-tooling/cli/test/commands/init/__snapshots__/templates.test.ts.snap @@ -12,7 +12,7 @@ Generated by \`prisma orm init\` with the Minimal template. ## Available scripts -- \`pnpm run dev\` — run the Prisma Next sample script +- \`pnpm run dev\` — run the Prisma ORM sample script ### Database and migrations @@ -24,18 +24,18 @@ Generated by \`prisma orm init\` with the Minimal template. - \`pnpm run migrate\` — apply the planned MongoDB migration - \`pnpm run db:seed\` — insert sample users manually -## Prisma Next +## Prisma ORM -Prisma Next setup is scaffolded in: +Prisma ORM setup is scaffolded in: - \`prisma/contract.ts\` - \`prisma.config.ts\` - \`prisma/db.ts\` - \`src/lib/prisma.ts\` -For provider-specific Prisma Next reference docs, see \`prisma-next.md\`. Prisma Next skills live in the upstream \`skills/\` directory: https://github.com/prisma/prisma/tree/main/skills. +For provider-specific Prisma ORM reference docs, see \`prisma-next.md\`. Prisma ORM skills live in the upstream \`skills/\` directory: https://github.com/prisma/prisma/tree/main/skills. -Node-based Prisma Next projects expect Node.js 24 LTS or newer. +Node-based Prisma ORM projects expect Node.js 24 LTS or newer. " `; @@ -51,7 +51,7 @@ Generated by \`prisma orm init\` with the Minimal template. ## Available scripts -- \`pnpm run dev\` — run the Prisma Next sample script +- \`pnpm run dev\` — run the Prisma ORM sample script ### Database and migrations @@ -62,18 +62,18 @@ Generated by \`prisma orm init\` with the Minimal template. - \`pnpm run migrate\` — apply a planned migration - \`pnpm run db:seed\` — insert sample users manually (run after \`db:init\`) -## Prisma Next +## Prisma ORM -Prisma Next setup is scaffolded in: +Prisma ORM setup is scaffolded in: - \`prisma/contract.prisma\` - \`prisma.config.ts\` - \`prisma/db.ts\` - \`src/lib/prisma.ts\` -For provider-specific Prisma Next reference docs, see \`prisma-next.md\`. Prisma Next skills live in the upstream \`skills/\` directory: https://github.com/prisma/prisma/tree/main/skills. +For provider-specific Prisma ORM reference docs, see \`prisma-next.md\`. Prisma ORM skills live in the upstream \`skills/\` directory: https://github.com/prisma/prisma/tree/main/skills. -Node-based Prisma Next projects expect Node.js 24 LTS or newer. +Node-based Prisma ORM projects expect Node.js 24 LTS or newer. " `; @@ -107,11 +107,11 @@ export const db = mongo({ `; exports[`templates > per-cell snapshots (FR5.4) > mongo + psl > quickReferenceMd is stable 1`] = ` -"# Welcome to Prisma Next! +"# Welcome to Prisma ORM! -Prisma Next lets you query your database in simple, easy-to-read TypeScript. Define what your data looks like, and Prisma Next gives you a fully typed client — with autocomplete for every collection, field, and relation. +Prisma ORM lets you query your database in simple, easy-to-read TypeScript. Define what your data looks like, and Prisma ORM gives you a fully typed client — with autocomplete for every collection, field, and relation. -This project is set up for MongoDB. Prisma Next also supports other databases. +This project is set up for MongoDB. Prisma ORM also supports other databases. ## Requirements @@ -154,7 +154,7 @@ Your contract has two companion files in the same directory: Commit both files to git. When you change your contract, run \`pnpm prisma contract emit\` to update them. -If you use a framework like Next.js or Vite, the Prisma Next plugin will do this for you automatically. +If you use a framework like Next.js or Vite, the Prisma ORM plugin will do this for you automatically. ## Configuration @@ -217,14 +217,14 @@ Multi-document transactions and change streams require MongoDB to run as a **rep - **\`mongodb-memory-server\`:** use \`MongoMemoryReplSet\` instead of \`MongoMemoryServer\` in tests. - **MongoDB Atlas:** every Atlas cluster is already a replica set. -The transaction API (\`db.transaction(...)\`) is on the roadmap and tracked under [TML-2313](https://linear.app/prisma-company/issue/TML-2313/mongo-dev-replica-set-story-is-missing-transactions-change-streams). Prisma Next's Mongo facade does not expose it yet — until that ticket lands, drive transactions yourself with a raw \`MongoClient\` using the escape hatch in the next section. +The transaction API (\`db.transaction(...)\`) is on the roadmap and tracked under [TML-2313](https://linear.app/prisma-company/issue/TML-2313/mongo-dev-replica-set-story-is-missing-transactions-change-streams). Prisma ORM's Mongo facade does not expose it yet — until that ticket lands, drive transactions yourself with a raw \`MongoClient\` using the escape hatch in the next section. ## Escape hatches The ORM covers the common cases. For the rest, two escape hatches are designed in: - **Typed raw aggregations — \`db.query\`.** The facade exposes \`db.query\`, a typed builder for aggregation pipelines that runs through the same runtime + middleware + codec stack as \`db.orm\`. Reach for it when the ORM can't express a \`$lookup\`/\`$facet\`/\`$graphLookup\`/window-function pipeline. -- **Direct \`mongodb\` driver control — \`mongoClient\` binding.** Construct your own \`MongoClient\` and pass it to \`mongo({ mongoClient, dbName, contractJson })\`. Your code keeps the \`MongoClient\` reference and uses it directly (transactions, change streams, sessions, anything Prisma Next doesn't surface yet); the same \`db\` object continues to give you the typed ORM. +- **Direct \`mongodb\` driver control — \`mongoClient\` binding.** Construct your own \`MongoClient\` and pass it to \`mongo({ mongoClient, dbName, contractJson })\`. Your code keeps the \`MongoClient\` reference and uses it directly (transactions, change streams, sessions, anything Prisma ORM doesn't surface yet); the same \`db\` object continues to give you the typed ORM. \`db.runtime()\` is **not** the escape hatch — it returns the internal executor (\`MongoRuntime\`), not a \`mongodb\` \`MongoClient\` or \`Db\`. Use \`db.query\` for raw aggregations and the \`mongoClient\` binding for direct driver control. @@ -233,8 +233,8 @@ The ORM covers the common cases. For the rest, two escape hatches are designed i If this project lives inside a pnpm workspace, a few things are worth knowing: - **Catalogs.** When the workspace's \`pnpm-workspace.yaml\` defines a \`catalogs\` entry for \`prisma\` or \`@internal/mongo\`, pnpm uses the catalog version everywhere — \`init\` does too. If you wanted the published \`latest\` instead, update or remove the catalog entry, then re-run \`pnpm install\`. -- **\`pnpm dlx\`.** \`pnpm dlx prisma@next orm init …\` works in any directory. Inside a workspace, pnpm still resolves dependencies through the workspace's catalog/overrides rather than the registry; expect the installed Prisma Next packages to reflect the workspace's catalog rather than \`latest\`. -- **\`pnpm\` → \`npm\` fallback.** If \`pnpm\` ever fails to install Prisma Next with a \`workspace:*\` or \`catalog:\` resolution error (a leak in a published artefact), \`init\` falls back to \`npm install\` and surfaces a warning. Once the offending package republishes a clean version you can switch back with \`pnpm install\`. +- **\`pnpm dlx\`.** \`pnpm dlx prisma@next orm init …\` works in any directory. Inside a workspace, pnpm still resolves dependencies through the workspace's catalog/overrides rather than the registry; expect the installed Prisma ORM packages to reflect the workspace's catalog rather than \`latest\`. +- **\`pnpm\` → \`npm\` fallback.** If \`pnpm\` ever fails to install Prisma ORM with a \`workspace:*\` or \`catalog:\` resolution error (a leak in a published artefact), \`init\` falls back to \`npm install\` and surfaces a warning. Once the offending package republishes a clean version you can switch back with \`pnpm install\`. " `; @@ -291,11 +291,11 @@ export const db = mongo({ `; exports[`templates > per-cell snapshots (FR5.4) > mongo + typescript > quickReferenceMd is stable 1`] = ` -"# Welcome to Prisma Next! +"# Welcome to Prisma ORM! -Prisma Next lets you query your database in simple, easy-to-read TypeScript. Define what your data looks like, and Prisma Next gives you a fully typed client — with autocomplete for every collection, field, and relation. +Prisma ORM lets you query your database in simple, easy-to-read TypeScript. Define what your data looks like, and Prisma ORM gives you a fully typed client — with autocomplete for every collection, field, and relation. -This project is set up for MongoDB. Prisma Next also supports other databases. +This project is set up for MongoDB. Prisma ORM also supports other databases. ## Requirements @@ -349,7 +349,7 @@ Your contract has two companion files in the same directory: Commit both files to git. When you change your contract, run \`pnpm prisma contract emit\` to update them. -If you use a framework like Next.js or Vite, the Prisma Next plugin will do this for you automatically. +If you use a framework like Next.js or Vite, the Prisma ORM plugin will do this for you automatically. ## Configuration @@ -412,14 +412,14 @@ Multi-document transactions and change streams require MongoDB to run as a **rep - **\`mongodb-memory-server\`:** use \`MongoMemoryReplSet\` instead of \`MongoMemoryServer\` in tests. - **MongoDB Atlas:** every Atlas cluster is already a replica set. -The transaction API (\`db.transaction(...)\`) is on the roadmap and tracked under [TML-2313](https://linear.app/prisma-company/issue/TML-2313/mongo-dev-replica-set-story-is-missing-transactions-change-streams). Prisma Next's Mongo facade does not expose it yet — until that ticket lands, drive transactions yourself with a raw \`MongoClient\` using the escape hatch in the next section. +The transaction API (\`db.transaction(...)\`) is on the roadmap and tracked under [TML-2313](https://linear.app/prisma-company/issue/TML-2313/mongo-dev-replica-set-story-is-missing-transactions-change-streams). Prisma ORM's Mongo facade does not expose it yet — until that ticket lands, drive transactions yourself with a raw \`MongoClient\` using the escape hatch in the next section. ## Escape hatches The ORM covers the common cases. For the rest, two escape hatches are designed in: - **Typed raw aggregations — \`db.query\`.** The facade exposes \`db.query\`, a typed builder for aggregation pipelines that runs through the same runtime + middleware + codec stack as \`db.orm\`. Reach for it when the ORM can't express a \`$lookup\`/\`$facet\`/\`$graphLookup\`/window-function pipeline. -- **Direct \`mongodb\` driver control — \`mongoClient\` binding.** Construct your own \`MongoClient\` and pass it to \`mongo({ mongoClient, dbName, contractJson })\`. Your code keeps the \`MongoClient\` reference and uses it directly (transactions, change streams, sessions, anything Prisma Next doesn't surface yet); the same \`db\` object continues to give you the typed ORM. +- **Direct \`mongodb\` driver control — \`mongoClient\` binding.** Construct your own \`MongoClient\` and pass it to \`mongo({ mongoClient, dbName, contractJson })\`. Your code keeps the \`MongoClient\` reference and uses it directly (transactions, change streams, sessions, anything Prisma ORM doesn't surface yet); the same \`db\` object continues to give you the typed ORM. \`db.runtime()\` is **not** the escape hatch — it returns the internal executor (\`MongoRuntime\`), not a \`mongodb\` \`MongoClient\` or \`Db\`. Use \`db.query\` for raw aggregations and the \`mongoClient\` binding for direct driver control. @@ -428,8 +428,8 @@ The ORM covers the common cases. For the rest, two escape hatches are designed i If this project lives inside a pnpm workspace, a few things are worth knowing: - **Catalogs.** When the workspace's \`pnpm-workspace.yaml\` defines a \`catalogs\` entry for \`prisma\` or \`@internal/mongo\`, pnpm uses the catalog version everywhere — \`init\` does too. If you wanted the published \`latest\` instead, update or remove the catalog entry, then re-run \`pnpm install\`. -- **\`pnpm dlx\`.** \`pnpm dlx prisma@next orm init …\` works in any directory. Inside a workspace, pnpm still resolves dependencies through the workspace's catalog/overrides rather than the registry; expect the installed Prisma Next packages to reflect the workspace's catalog rather than \`latest\`. -- **\`pnpm\` → \`npm\` fallback.** If \`pnpm\` ever fails to install Prisma Next with a \`workspace:*\` or \`catalog:\` resolution error (a leak in a published artefact), \`init\` falls back to \`npm install\` and surfaces a warning. Once the offending package republishes a clean version you can switch back with \`pnpm install\`. +- **\`pnpm dlx\`.** \`pnpm dlx prisma@next orm init …\` works in any directory. Inside a workspace, pnpm still resolves dependencies through the workspace's catalog/overrides rather than the registry; expect the installed Prisma ORM packages to reflect the workspace's catalog rather than \`latest\`. +- **\`pnpm\` → \`npm\` fallback.** If \`pnpm\` ever fails to install Prisma ORM with a \`workspace:*\` or \`catalog:\` resolution error (a leak in a published artefact), \`init\` falls back to \`npm install\` and surfaces a warning. Once the offending package republishes a clean version you can switch back with \`pnpm install\`. " `; @@ -501,11 +501,11 @@ export const db = postgres({ `; exports[`templates > per-cell snapshots (FR5.4) > postgres + psl > quickReferenceMd is stable 1`] = ` -"# Welcome to Prisma Next! +"# Welcome to Prisma ORM! -Prisma Next lets you query your database in simple, easy-to-read TypeScript. Define what your data looks like, and Prisma Next gives you a fully typed client — with autocomplete for every table, column, and relation. +Prisma ORM lets you query your database in simple, easy-to-read TypeScript. Define what your data looks like, and Prisma ORM gives you a fully typed client — with autocomplete for every table, column, and relation. -This project is set up for PostgreSQL. Prisma Next also supports other databases. +This project is set up for PostgreSQL. Prisma ORM also supports other databases. ## Requirements @@ -545,7 +545,7 @@ Your contract has two companion files in the same directory: Commit both files to git. When you change your contract, run \`pnpm prisma contract emit\` to update them. -If you use a framework like Next.js or Vite, the Prisma Next plugin will do this for you automatically. +If you use a framework like Next.js or Vite, the Prisma ORM plugin will do this for you automatically. ## Configuration @@ -605,8 +605,8 @@ pnpm prisma migration status # Show migration status If this project lives inside a pnpm workspace, a few things are worth knowing: - **Catalogs.** When the workspace's \`pnpm-workspace.yaml\` defines a \`catalogs\` entry for \`prisma\` or \`@internal/postgres\`, pnpm uses the catalog version everywhere — \`init\` does too. If you wanted the published \`latest\` instead, update or remove the catalog entry, then re-run \`pnpm install\`. -- **\`pnpm dlx\`.** \`pnpm dlx prisma@next orm init …\` works in any directory. Inside a workspace, pnpm still resolves dependencies through the workspace's catalog/overrides rather than the registry; expect the installed Prisma Next packages to reflect the workspace's catalog rather than \`latest\`. -- **\`pnpm\` → \`npm\` fallback.** If \`pnpm\` ever fails to install Prisma Next with a \`workspace:*\` or \`catalog:\` resolution error (a leak in a published artefact), \`init\` falls back to \`npm install\` and surfaces a warning. Once the offending package republishes a clean version you can switch back with \`pnpm install\`. +- **\`pnpm dlx\`.** \`pnpm dlx prisma@next orm init …\` works in any directory. Inside a workspace, pnpm still resolves dependencies through the workspace's catalog/overrides rather than the registry; expect the installed Prisma ORM packages to reflect the workspace's catalog rather than \`latest\`. +- **\`pnpm\` → \`npm\` fallback.** If \`pnpm\` ever fails to install Prisma ORM with a \`workspace:*\` or \`catalog:\` resolution error (a leak in a published artefact), \`init\` falls back to \`npm install\` and surfaces a warning. Once the offending package republishes a clean version you can switch back with \`pnpm install\`. " `; @@ -665,11 +665,11 @@ export const db = postgres({ `; exports[`templates > per-cell snapshots (FR5.4) > postgres + typescript > quickReferenceMd is stable 1`] = ` -"# Welcome to Prisma Next! +"# Welcome to Prisma ORM! -Prisma Next lets you query your database in simple, easy-to-read TypeScript. Define what your data looks like, and Prisma Next gives you a fully typed client — with autocomplete for every table, column, and relation. +Prisma ORM lets you query your database in simple, easy-to-read TypeScript. Define what your data looks like, and Prisma ORM gives you a fully typed client — with autocomplete for every table, column, and relation. -This project is set up for PostgreSQL. Prisma Next also supports other databases. +This project is set up for PostgreSQL. Prisma ORM also supports other databases. ## Requirements @@ -720,7 +720,7 @@ Your contract has two companion files in the same directory: Commit both files to git. When you change your contract, run \`pnpm prisma contract emit\` to update them. -If you use a framework like Next.js or Vite, the Prisma Next plugin will do this for you automatically. +If you use a framework like Next.js or Vite, the Prisma ORM plugin will do this for you automatically. ## Configuration @@ -780,8 +780,8 @@ pnpm prisma migration status # Show migration status If this project lives inside a pnpm workspace, a few things are worth knowing: - **Catalogs.** When the workspace's \`pnpm-workspace.yaml\` defines a \`catalogs\` entry for \`prisma\` or \`@internal/postgres\`, pnpm uses the catalog version everywhere — \`init\` does too. If you wanted the published \`latest\` instead, update or remove the catalog entry, then re-run \`pnpm install\`. -- **\`pnpm dlx\`.** \`pnpm dlx prisma@next orm init …\` works in any directory. Inside a workspace, pnpm still resolves dependencies through the workspace's catalog/overrides rather than the registry; expect the installed Prisma Next packages to reflect the workspace's catalog rather than \`latest\`. -- **\`pnpm\` → \`npm\` fallback.** If \`pnpm\` ever fails to install Prisma Next with a \`workspace:*\` or \`catalog:\` resolution error (a leak in a published artefact), \`init\` falls back to \`npm install\` and surfaces a warning. Once the offending package republishes a clean version you can switch back with \`pnpm install\`. +- **\`pnpm dlx\`.** \`pnpm dlx prisma@next orm init …\` works in any directory. Inside a workspace, pnpm still resolves dependencies through the workspace's catalog/overrides rather than the registry; expect the installed Prisma ORM packages to reflect the workspace's catalog rather than \`latest\`. +- **\`pnpm\` → \`npm\` fallback.** If \`pnpm\` ever fails to install Prisma ORM with a \`workspace:*\` or \`catalog:\` resolution error (a leak in a published artefact), \`init\` falls back to \`npm install\` and surfaces a warning. Once the offending package republishes a clean version you can switch back with \`pnpm install\`. " `; diff --git a/packages/1-framework/3-tooling/cli/test/orm/config-section.test.ts b/packages/1-framework/3-tooling/cli/test/orm/config-section.test.ts index 04e1a762f11e..37d40fe70b12 100644 --- a/packages/1-framework/3-tooling/cli/test/orm/config-section.test.ts +++ b/packages/1-framework/3-tooling/cli/test/orm/config-section.test.ts @@ -66,7 +66,7 @@ describe('ormConfigSection', () => { { code: 'CONFIG.FILE_NOT_FOUND', severity: 'error', - summary: 'No Prisma Next configuration was loaded', + summary: 'No Prisma ORM configuration was loaded', why: 'The orm config section is absent, so prisma.config.ts was never evaluated.', nextActions: [ { @@ -175,7 +175,7 @@ describe('ormConfigSection', () => { { code: 'CONFIG.VALIDATION_FAILED', severity: 'error', - summary: 'Prisma Next configuration must be an object', + summary: 'Prisma ORM configuration must be an object', why: 'The orm config section is not an object, so no section can be read from it.', nextActions: [ {