Skip to content
Back to skills

Prisma Knowledge Patch

ASecurity

Prisma

  • 25 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added May 27, 2026
developmenttypescriptrustsqlreactnodedockerapidatabasesecurity

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill prisma-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Prisma Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Prisma Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-prisma-knowledge-patch/badge)](https://www.skillsdirectory.com/skills/nevaberry-prisma-knowledge-patch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: prisma-knowledge-patch
description: Prisma
version: "7.10.1"
license: MIT
metadata:
  author: Nevaberry
---




# Prisma knowledge patch

Load this skill when upgrading Prisma, configuring clients or the CLI,
working with schemas and queries, or using Prisma Postgres and related products.
The topic references contain complete guidance, examples, and version-specific details.

## Reference index

| Reference | Topics |
| --- | --- |
| [Upgrading and configuration](references/upgrading-and-configuration.md) | Runtime requirements, Prisma Config, removed options, CLI connections, Prisma 7/8 coexistence, Prisma Next contracts |
| [Client generation and driver adapters](references/client-generation-and-adapters.md) | TypeScript output, runtimes, Query Compiler, cache, database adapters, error mappings |
| [Schema, migrations, and queries](references/schema-migrations-and-queries.md) | Schema files, views, indexes, migrations, filters, transactions, value handling, Prisma 8 schemas |
| [Client Extensions and observability](references/extensions-and-observability.md) | Extension order, computed fields, tracing, SQL comments, metrics, Prisma 8 extensions |
| [Prisma Postgres and products](references/prisma-postgres-and-products.md) | Hosted and local databases, connections, Console, Management API, Accelerate, Optimize, Pulse, Compute, Object Store |
| [Studio and tooling](references/studio-and-tooling.md) | Studio, VS Code, MCP, bootstrap, CLI diagnostics, agent confirmation |

## Breaking changes and upgrade requirements

### Runtime and modules

Prisma 7 requires Node.js 20.19.0 or later and, for TypeScript projects,
TypeScript 5.4.0 or later. It ships as an ES module; set `"type": "module"`
in `package.json`. The upgrade guide uses these TypeScript settings:

```json
{
  "compilerOptions": {
    "module": "ESNext",
    "moduleResolution": "bundler",
    "target": "ES2023"
  }
}
```

On the 6.x release line, upgrade to 6.19.3 for the `effect` security update.
Upgrade to 7.10.1 for the dependency security updates detailed in the upgrade reference.

### Connections and Prisma Config

In Prisma 7, `PrismaClient` requires `adapter` for direct connections or
`accelerateUrl` for Accelerate. Migrate calls using `datasources` or `datasourceUrl`.
Pass an existing Accelerate URL directly to `accelerateUrl`.

Introspection and migrations require `prisma.config.ts`. Keep the provider in
`schema.prisma`; move `url` and any `shadowDatabaseUrl` to the config. If you used
a separate migration connection, set the config URL to the former `directUrl`.
CLI commands can also use the application's `prisma://` or `prisma+postgres://`
URL; a separate direct URL for migrations is optional.

```ts
import { defineConfig, env } from 'prisma/config'

export default defineConfig({
  datasource: {
    url: env('DATABASE_URL'),
    shadowDatabaseUrl: env('SHADOW_DATABASE_URL'),
  },
})
```

Remove Prisma Config's `engine` and `adapter` options for Prisma 7. Move
`package.json` settings `prisma.schema` and `prisma.seed` to `schema` and
`migrations.seed`. Stable configs no longer use `earlyAccess`.
With Prisma Config present, the CLI skips automatic `.env` loading; projects
using `.env` should install `dotenv` and add `import 'dotenv/config'` to the config.

### Generation, seeding, and removed flags

In Prisma 7, package installation and migration commands no longer generate
Prisma Client, and migration commands no longer seed automatically. Run
`prisma generate` as part of the build and `prisma db seed` when intending to seed.
Run `prisma generate` explicitly after `prisma db push` when the client needs updating.

- Drop `--data-proxy`, `--accelerate`, `--no-engine`, and `--allow-no-models`
  from `prisma generate` scripts.
- Remove `--skip-generate` from `prisma migrate dev` and `prisma db push`,
  and remove `--skip-seed` from `prisma migrate dev`.
- Replace `prisma introspect` with `prisma db pull`.
- For `prisma db execute`, replace `--schema` and `--url` with Prisma Config settings.
- Use `--from-schema` / `--to-schema` and config-datasource diff flags as
  detailed in the upgrade reference; a diff reads only one configured datasource.

### Client output and adapter imports

Remove `engineType = "library"`, `engineType = "binary"`, and the
`runtime = "react-native"` target when upgrading to Prisma 7.
For `prisma-client-js` with custom output, install `@prisma/client-runtime-utils`.
With that generator, replace edge-runtime `/wasm` imports with `/edge`.

| Previous adapter export | Prisma 7 export |
| --- | --- |
| `PrismaBetterSQLite3` | `PrismaBetterSqlite3` |
| `PrismaD1HTTP` | `PrismaD1Http` |
| `PrismaLibSQL` | `PrismaLibSql` |
| `PrismaNeonHTTP` | `PrismaNeonHttp` |

### Schema and migration transitions

For Prisma 6, rename models named `async`, `await`, or `using`. The first
PostgreSQL migration after upgrading replaces the unique index on `("A", "B")`
with a composite primary key on every implicit many-to-many join table;
create a dedicated migration to keep those changes together.

Remove `fullTextIndex` from `previewFeatures`. PostgreSQL full-text search stays
in Preview in Prisma 6: replace `fullTextSearch` with `fullTextSearchPostgres`.
After the v7 enum reversion, generated TypeScript uses the schema member name:
`PENDING @map("pending")` yields `SuggestionStatus.PENDING` equal to `"PENDING"`,
while the database stores `"pending"`.

The `postgresqlExtensions` Preview feature is deprecated. Create a draft
migration and add the extension SQL to its `migration.sql`.
Use a separate shadow database for `prisma migrate diff --from-migrations`.
Prisma Migrate 7.10.1 returns `P3025` if the shadow URL points to the main database;
earlier versions could drop and rebuild the main schema and report an empty diff.

### Prisma Next facade and contract migration

Replace direct `@prisma-next/*` dependencies with the database facade and any
`@prisma/orm-extension-*` packs used. Regenerate the contract to rewrite imports;
the package switch itself preserves `contractHash`.
Replacing `extensionPacks` with `extensions` changes contract hashes, so re-emit
the contract and re-anchor migrations. Use `contract.source.format` instead of
`contract.source.sourceFormat`, and `output` instead of `outputPath` in facade config.

Use bare hex hashes: loaders reject `sha256:`. This preserves the contract digest
but changes `migrationHash` values. The shared-snapshot layout conversion separately
verifies that it preserves each `migrationHash`; see the upgrade reference for tools.

## Client generation and connection defaults

The generally available `prisma-client` generator requires explicit `output`,
emits TypeScript to build with the application, and emits ESM-compatible code by
default. Set `moduleFormat` to `"esm"` or `"cjs"` to match the application.
With TypeScript `module` set to `"node16"` or `"nodenext"`, it infers module format
from the nearest `package.json` `type`, defaulting to CommonJS when `type` is absent.

For the generally available Rust-free client, replace the `queryCompiler` and
`driverAdapters` Preview flags with `engineType = "client"`.
`compilerBuild` defaults to `"fast"` for query speed; `"small"` uses a smaller build.
Set `queryPlanCacheMaxSize` on `PrismaClient` to cap the query plan cache;
`0` disables it, and omission keeps the default size.

Driver adapters inherit driver pool defaults. The `pg` connection timeout defaults
to `0`; set a five-second timeout to retain the Prisma 6 default.
The `pg` adapter validates TLS certificates by default. A trust failure can surface
as `P1010`; use `NODE_EXTRA_CA_CERTS` or Node's `--use-openssl-ca` as detailed in the reference.

## Schema and query quick reference

- Multi-file schemas are generally available; remove `prismaSchemaFolder` from
  `previewFeatures`. Multi-schema uses `schemas` and `@@schema("name")` without its Preview flag.
- SQLite supports `Json` fields and schema enums. Top-level `updateMany()` and
  `deleteMany()` accept `limit`.
- JSON string filters support `mode: 'insensitive'` with `string_contains`,
  `string_starts_with`, and `string_ends_with`; JSON string `equals` also honors the mode.
- Enable the `partialIndexes` Preview flag to use `where` on `@@index` and `@@unique`
  for PostgreSQL, SQLite, SQL Server, and CockroachDB. Field-level `@unique` supports
  `where` starting in 7.4.1.
- A partial unique index alone no longer qualifies its fields for `findUnique`;
  these indexes are omitted from DMMF `uniqueFields` and `uniqueIndexes`.
- PostgreSQL migrations can use `CREATE INDEX CONCURRENTLY` without an explicit
  transaction block; shadow database replay also supports it.
- Invalid `Date` arguments to `$queryRaw` and `$executeRaw` raise validation errors.
  Pass `null` explicitly to send SQL `NULL`.

## Transactions and extensions

Awaited interactive transactions reject on database commit errors, including
trigger errors. Nested `$transaction()` callbacks use savepoints on SQL databases
with savepoint support; an outer rollback undoes successful inner writes.
The D1 adapter treats savepoint creation, rollback, and release as no-ops, so
rolling back to a savepoint leaves writes in place. In 7.10.1, nested transaction
options remain unchanged and can be reused in later top-level transactions.

For duplicate extension methods, the last extension wins. Query hooks run in
registration order, and `query(args)` passes control to the next hook.
Register `$on()` listeners before `$extends()`. Client-level methods may be absent
on extended clients; check availability before calling methods such as `$connect()`.
Use `Prisma.Result` with the extended delegate, arguments, and operation to include
selected computed fields. Result `compute` receives the typed model name as its second argument.

Tracing is generally available: remove its Preview flag and install
`@opentelemetry/api` if absent as a direct dependency. It is a peer dependency of
`@prisma/instrumentation`. Use `prisma:engine:query` in span filters.
SQL commenter plugins add query tags and sampled trace context to SQL.
Prisma 7 removes Metrics Preview; use driver metrics where available or count
model queries with `query.$allModels.$allOperations` in a Client Extension.

## Prisma Postgres and developer workflows

Use `npx prisma init --db` to provision hosted Prisma Postgres. `npx prisma dev`
starts a local instance without Docker; local databases persist across invocations.
Direct connections are generally available; `pool=true` enables pooling for
standard PostgreSQL clients. `npx create-db` creates a database without signing in;
it is deleted after 24 hours unless claimed in Prisma Console.

Accelerate supports on-demand cache invalidation and plan-dependent query duration
and response-size limits. Compute is generally available for production apps;
the Free plan includes one million requests per month. See the product reference
for deployment configuration, environments, APIs, and Object Store buckets.

`prisma bootstrap` sets up a Prisma Postgres project interactively, prompts before
changes, and skips completed steps when rerun. Studio offers SQL queries, raw SQL
filters, multiple-cell editing, relation navigation, and migration history for
databases containing a Prisma Next migration ledger.

Agent-detected destructive commands require explicit confirmation. This includes
`prisma migrate reset --force`, `prisma db push --accept-data-loss`, and interactive
schema pushes presenting data-loss confirmation. The MCP `migrate-reset` tool was
removed; run resets through the CLI.

Files in this skill

  • SKILL.md4.2 KB
  • references/observability.md1.3 KB
  • references/prisma7-migration.md5 KB
  • references/query-api.md703 B
  • references/schema-features.md1.4 KB
  • references/v7-migration.md3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.