Open-Source Wikis

/

Prisma

/

Packages

/

engines

prisma/prisma

engines

Active contributors: jacek-prisma, Oleksii Orlenko

Purpose

@prisma/engines is the package that downloads and resolves engine binaries at install time. It's a thin runtime package whose main asset is the postinstall script that fetches the Schema Engine binary appropriate for the host platform.

Historically @prisma/engines also fetched a query engine binary; that binary no longer exists in Prisma 7. Today the only engine still distributed as a native binary is the Schema Engine. The query compiler is shipped as Wasm in @prisma/query-compiler-wasm and the PSL parser/formatter as Wasm in @prisma/prisma-schema-wasm.

Directory layout

packages/engines/
├── src/
│   ├── ...           # Engine path resolution helpers
│   └── scripts/      # Postinstall logic
├── README.md
└── package.json

The actual download mechanics live in @prisma/fetch-engine. @prisma/engines is the user-facing wrapper that exports getEnginesPath() and friends.

Engine version pinning

The engines version is pinned via a sibling package, @prisma/engines-version, which is bumped automatically by update-engines-version.yml. The bot author is Prismo, and these version-bump commits are why package.json files dominate the churn list (see By the numbers).

To bump engines locally:

pnpm bump-engines

The script (scripts/bump-engines.ts) updates the version everywhere it's referenced and re-runs pnpm install to rehydrate.

Engine override (for development)

For developing against a specific engine branch or local build, edit packages/fetch-engine/package.json:

{
  "enginesOverride": {
    "branch": "feat/column-comparison"
  }
}

or

{
  "enginesOverride": {
    "folder": "/home/john/dev/prisma/prisma-engines/target/release"
  }
}

Then pnpm install to propagate.

The check pnpm check-engines-override (scripts/check-engines-override.ts) ensures no override accidentally ships with a release. This is a fail-safe — a stale enginesOverride would otherwise pin every published artifact to a development branch.

Integration points

  • @prisma/fetch-engine — the actual download/cache logic
  • @prisma/get-platform — host platform detection (used to pick the right binary)
  • @prisma/engines-version — pin file
  • Used by packages/cli and packages/migrate (they call getEnginesPath() to find the schema-engine binary)

Entry points for modification

  • Change download behavior: packages/fetch-engine/
  • Change platform detection: packages/get-platform/
  • Change engine version: don't — let update-engines-version.yml do it, or use pnpm bump-engines for one-off bumps

See also

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

engines – Prisma wiki | Factory