Skip to content
Back to skills

Prisma Knowledge Patch

ASecurity

Prisma

  • 25 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 5, 2026
developmenttypescriptrustgoshellsqlreactnodedockergitapi

Works with

  • cursor
  • cli
  • api
  • mcp

Security analysis

A100/100

Pro scans all 8 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-nevaberry-plugins/badge)](https://www.skillsdirectory.com/skills/nevaberry-prisma-knowledge-patch-nevaberry-plugins)

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 compatibility guidance

Load this skill when upgrading Prisma, configuring its CLI or generated client,
working with schemas and migrations, or using Prisma's database products.
Use the topic references for complete examples and version-specific behavior.
Historical Early Access and Preview instructions retain their original scope.

## Reference index

| Reference | Topics |
| --- | --- |
| [Upgrading and configuration](references/upgrading-and-configuration.md) | Runtime requirements, Prisma Config, CLI replacements, security updates, Prisma 7/8 coexistence, Prisma Next packages |
| [Client generation and adapters](references/client-generation-and-adapters.md) | Generated TypeScript, runtimes, Rust-free client, connection options, adapter defaults and errors |
| [Extensions and observability](references/extensions-and-observability.md) | Extension composition, computed fields, replicas, tracing, SQL comments |
| [Schema, migrations, and queries](references/schema-migrations-and-queries.md) | Schema features, indexes, views, migration safeguards, transactions, query fixes, Prisma Next contracts |
| [Studio and tooling](references/studio-and-tooling.md) | Studio, VS Code, MCP, bootstrap, shell completion, CLI diagnostics |
| [Prisma Postgres and products](references/prisma-postgres-and-products.md) | Hosted/local databases, pooling, regions, Console, APIs, Accelerate, Optimize, Pulse, Compute, Object Store, integrations |

## Upgrade requirements and removed behavior

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 `module: "ESNext"`,
`moduleResolution: "bundler"`, and `target: "ES2023"` for TypeScript.

For Prisma 6 upgrades, check both Node.js and TypeScript against the upgrade
requirements. Rename models named `async`, `await`, or `using` before upgrading.
The first PostgreSQL migration replaces the unique index on `("A", "B")`
with a composite primary key on implicit many-to-many join tables; create a
dedicated migration to keep those changes together.

In Prisma 7, remove `engineType = "library"`, `engineType = "binary"`, and
the removed `runtime = "react-native"` target. If keeping `prisma-client-js`
with custom `output`, install `@prisma/client-runtime-utils`. For that
generator's edge-runtime imports, replace `/wasm` with `/edge`.

The Metrics Preview feature is removed in Prisma 7. Use database-driver metrics
where available, or count model queries with a Client Extension using
`query.$allModels.$allOperations`.

After the v7 enum reversion, generated TypeScript uses schema member names:
`PENDING @map("pending")` produces `SuggestionStatus.PENDING` equal to
`"PENDING"`, while the database stores `"pending"`.

## Separate CLI and application connection settings

For Prisma 7 introspection and migrations, keep the provider in `schema.prisma`
and move `url` and any `shadowDatabaseUrl` to `prisma.config.ts`.
If a separate migration connection used `directUrl`, use that URL in the config.
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 legacy `engine` and `adapter` options for Prisma 7.
Move `package.json`'s `prisma.schema` and `prisma.seed` to `schema` and
`migrations.seed`. In Prisma 6.13.0, remove `earlyAccess` from stable configs;
use `experimental` to opt into features such as CLI driver adapters.
With Prisma Config present, the CLI skips automatic `.env` loading. If needed,
install `dotenv` and add `import 'dotenv/config'` to the config.

Prisma 7's `PrismaClient` requires `adapter` for direct connections or
`accelerateUrl` for Accelerate. Migrate calls using `datasources` or
`datasourceUrl`; pass an existing Accelerate URL directly to `accelerateUrl`.

## Explicit generation, seeding, and CLI flags

Prisma 7 package installation and migration commands no longer generate the
client; migration commands no longer seed automatically. Run `prisma generate`
as part of the build and `prisma db seed` when intending to seed.

- Remove `--data-proxy`, `--accelerate`, `--no-engine`, and `--allow-no-models`
  from generation scripts.
- Remove `--skip-generate` from `prisma migrate dev` and `prisma db push`, and
  `--skip-seed` from `prisma migrate dev`.
- Replace `prisma introspect` with `prisma db pull`.
- Use `--from-schema` / `--to-schema` and `--from-config-datasource` /
  `--to-config-datasource` for migration diffs. A diff reads only one configured
  datasource and cannot directly compare two distinct database URLs.
- For `prisma db execute`, replace `--schema` and `--url` with Prisma Config
  settings. Replace `migrate diff --shadow-database-url` with
  `datasource.shadowDatabaseUrl`.

From Prisma 7.2.0, `prisma db pull`, `prisma db push`, and `prisma migrate dev`
accept `--url` for an individual invocation. `prisma generate` can run with an
undefined `datasource.url`; pass `process.env.DATABASE_URL` directly to allow
config loading when the variable is unset.

## Migration safety and dependency updates

`prisma migrate dev` exits with an error on schema drift or a migration it
cannot apply cleanly. Resetting and discarding development data requires an
explicit `npx prisma migrate reset`. When Prisma detects an agent invoking
destructive commands, it requires confirmation even with `--force`. Agent
consent also applies to
`prisma db push --accept-data-loss` and interactive data-loss confirmations.

Prisma Migrate 7.10.1 rejects the main database as a shadow database with `P3025`.
Use a separate shadow database for `prisma migrate diff --from-migrations`:
earlier versions could drop and rebuild the main schema and report an empty diff
when both URLs pointed to it. Prisma 8 removes reset and shadow databases from
its migration workflow and verifies each migration step.

On the 6.x line, upgrade to 6.19.3 for the `effect` security update.
Upgrade to 7.10.1 for security updates to `mysql2`, `fast-uri`, `deepmerge-ts`,
`mariadb`, and `source-map-js`; the MariaDB adapter's dependency becomes 3.5.4.

## Generated client and adapter choices

`prisma-client` requires explicit `output` and emits TypeScript built with the
application. Set `moduleFormat` to `"esm"` or `"cjs"` to match the app.
With TypeScript `module` set to `"node16"` or `"nodenext"`, it infers module
format from the nearest `package.json` `type`, defaulting to CommonJS if absent.
`compilerBuild` defaults to `"fast"`; `"small"` uses a smaller compiler build.

For the Rust-free setup in Prisma 6.16.0, replace `queryCompiler` and
`driverAdapters` Preview flags with `engineType = "client"`.
Prisma 7 renames adapter exports to `PrismaBetterSqlite3`, `PrismaD1Http`,
`PrismaLibSql`, and `PrismaNeonHttp`.

Driver adapters inherit driver pool defaults. The `pg` connection timeout
defaults to `0`; set a five-second timeout in adapter pool options to retain
the Prisma 6 default. The `pg` adapter validates TLS certificates by default;
trust failures can surface as `P1010`. Use `NODE_EXTRA_CA_CERTS` for the database
CA certificate or Node's `--use-openssl-ca` for the OpenSSL trust store.

## Schema and index changes

Remove `prismaSchemaFolder` when using generally available multi-file schemas.
For explicit schema folders, place migrations next to the file containing the
`datasource` block. Multi-schema uses `schemas` and `@@schema("name")` without
its Preview flag. SQLite supports `Json` fields and schema enums.

Remove `fullTextIndex` from `previewFeatures` after its graduation. PostgreSQL
full-text search stays in Preview in Prisma 6: replace `fullTextSearch` with
`fullTextSearchPostgres`. The `postgresqlExtensions` Preview feature is
deprecated; create a draft migration and add extension SQL to `migration.sql`.

Enable `partialIndexes` for `where` on `@@index` and `@@unique` on PostgreSQL,
SQLite, SQL Server, or CockroachDB. Field-level `@unique(where: ...)` starts in
7.4.1. A partial unique index alone does not qualify as a `findUnique` selector.
PostgreSQL `CREATE INDEX CONCURRENTLY` belongs in a migration without an
explicit transaction block; shadow database replay is supported in 7.8.0.

SQL views remain Preview. `@unique` on already-unique view results enables
relationships and restores `findUnique`, cursor pagination, and implicit
ordering. `tables.external` makes Migrate ignore listed tables while their
models remain queryable through the client.

## Queries and transaction behavior

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 equality also honors that mode.
`queryPlanCacheMaxSize` caps the plan cache; `0` disables it and omission keeps
the default size.

Awaited interactive transactions reject 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 rollback to a savepoint leaves writes in place.

In 7.10.1, nested transaction options stay unchanged and can be reused by a
later top-level transaction. Parameter chunks execute in a transaction, and a
later chunk's failure rolls back earlier writes. Invalid `Date` arguments to
`$queryRaw` or `$executeRaw` raise validation errors; pass `null` for SQL `NULL`.

## Extensions and observability

Register `$on()` listeners before `$extends()`. Conflicting methods use the last
extension; query hooks run in registration order, with `query(args)` passing
control to the next hook. 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 in the result type.

Tracing is generally available: remove `tracing` from `previewFeatures` and
install `@opentelemetry/api` directly if needed. It is a peer dependency of
`@prisma/instrumentation`. Use `prisma:engine:query` in span-name filters.
SQL commenter plugins go in `PrismaClient`'s `comments` list; `queryTags()` and
`withMergedQueryTags` attach scoped tags, and `traceContext()` adds `traceparent`
when instrumentation is configured and the active span is sampled.

## Database products and Prisma Next workflows

Use `prisma init --db` to provision hosted Prisma Postgres, `prisma dev` for a
local instance without Docker, and `prisma postgres link` for an existing
project. `prisma bootstrap` prompts before changes and skips completed steps.
Add `pool=true` to direct Prisma Postgres URLs for connection pooling.
Accelerate supports on-demand cache invalidation and plan-dependent limits on
query duration and response size.

Compute supports production apps, long-lived Bun processes, GitHub repository
imports, branch apps and databases, preview URLs, and custom-domain TLS.
Configure deployments with `prisma.compute.ts`; automate apps and deployments
through `/v1/apps` and `/v1/deployments`.

For Prisma Next package upgrades, replace direct `@prisma-next/*` dependencies
with a database facade plus any extension packs you use, then regenerate the contract.
The package switch preserves `contractHash`; renaming `extensionPacks` to
`extensions` changes contract hashes and requires re-emission and re-anchoring
of migrations. Bare hexadecimal hashes replace `sha256:` prefixes: the digest
is preserved but `migrationHash` changes. Shared snapshot layout conversion
separately verifies that each `migrationHash` is preserved.

Files in this skill

  • SKILL.md9 KB
  • coverage.json3.3 KB
  • references/client-generation-and-adapters.md6.8 KB
  • references/extensions-and-observability.md4 KB
  • references/prisma-postgres-and-products.md6.5 KB
  • references/schema-migrations-and-queries.md7.4 KB
  • references/studio-and-tooling.md4.5 KB
  • references/upgrading-and-configuration.md6.6 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.