Open-Source Wikis

/

Prisma

/

Lore

prisma/prisma

Lore

The story of prisma/prisma, told from the git history. Dates are derived from commit timestamps; "appears to have been" / "likely" hedges where intent isn't clear.

Eras

The first commits (Apr 2019)

The repository's first commit is 9c076bbfd init on 2019-04-29, followed by a string of wip commits in May 2019. This is the start of the modern monorepo. The early architecture was very different from today: it included a TypeScript wrapper around a native Rust query engine binary, a separate introspection engine, a migration engine, and a Prisma format binary — all four eventually consolidated into the Schema Engine and the Wasm query compiler used today.

Multi-engine stabilization (2019–2021)

Through 2019 and 2020 the repo grew the foundations of what users still recognize as Prisma: prisma init, the schema language, Prisma Client generation, and the four-engine architecture. By the time of Prisma 2 GA (2020), the layout of packages/cli, packages/client, packages/migrate, and packages/engines was largely as it appears today, although the engines were native binaries and the client made HTTP/IPC calls to the query engine subprocess.

Driver adapters introduction (Aug 2023 onward)

Driver adapters appeared as a preview feature in 2023, starting with adapter-neon and adapter-planetscale, allowing Prisma Client to talk to a database through an in-process JavaScript driver instead of the Rust query engine. Over the next two years more adapters were added: adapter-pg, adapter-libsql, adapter-d1, adapter-better-sqlite3, adapter-mssql, adapter-mariadb, and adapter-ppg (Prisma Postgres Serverless). The adapter contract matured in packages/driver-adapter-utils over the same period.

The Prisma 7 rearchitecture (2024–2026)

The largest single shift in the codebase is the move to driver adapters as the default, the deletion of the native query engine, and a Wasm query compiler running in-process. The relevant artifacts:

  • packages/client-engine-runtime — created to host the new QueryInterpreter and TransactionManager. The query engine no longer exists as a separate binary; queries are compiled by @prisma/query-compiler-wasm and executed by interpreter code in this repo.
  • packages/client-generator-ts — the new prisma-client generator, alongside the legacy packages/client-generator-js.
  • packages/client-common, packages/client-runtime-utils, packages/client-generator-registry — extracted from the client/generator packages to share code.
  • prisma.config.ts — replaces datasource URLs and env() in the schema. Loaded by packages/config.

AGENTS.md (formerly thought of as a notes file) is the canonical record of these decisions. Its "Knowledge reminders" section explicitly tells future contributors and AI agents: there is no longer a "query engine" in Prisma, there are no database URLs in Prisma schema files, Prisma uses JavaScript drivers, query execution code is written in TypeScript in Prisma.

The Schema Engine remains a native Rust binary because migrations are inherently DDL-heavy and benefit from the existing Rust toolchain in prisma-engines.

Recent (late 2025 – early 2026)

Recent commits show ongoing polish of the new stack rather than another rearchitecture:

  • Apr 2026: chore: remove parameterization from sqlcommenter-query-insights (#29518), fix(client-engine-runtime): surface unmapped driver errors as user-facing P2039 (#29512), fix(docker): make MongoDB replica set init idempotent (#29515).
  • Mar 2026: ongoing client-engine-runtime fixes, more driver adapter polish.
  • Nov 2025: a noticeable spike in commit volume (134 commits) — likely a release cycle landing changes.
  • New error code P2039 introduced for unmapped database-specific driver-adapter errors (see packages/client-engine-runtime/src/user-facing-error.ts); P2038 assigned for missing-driver-adapter PrismaClientInitializationError.

Longest-standing features

These have survived from the early days through every rewrite:

  • Prisma Schema Language and the schema.prisma file. The PSL parser has moved (Rust → Rust+Wasm) but the syntax has been remarkably stable.
  • prisma generate as the contract between the schema and Client. The dispatch logic in packages/cli/src/Generate.ts has changed many times, but the user-facing command and behavior are basically unchanged from 2019.
  • The DMMF. Its shape has evolved (and is explicitly marked unstable), but the concept of "JSON AST of the schema, fed to generators" persists.
  • prisma migrate semantics. The Rust engine on the other side has been rebuilt several times; the CLI surface (migrate dev, migrate deploy, db push, db pull) is from the early Migrate-era and is intact today.

Deprecated / removed features

  • The native query engine binary — historically downloaded by @prisma/engines alongside the schema engine, removed during the Prisma 7 rearchitecture. There is no Rust query engine in this repo any more; the Wasm query compiler took over.
  • Automatic .env loading by Prisma. Prisma 7 stops auto-loading .env — users must use dotenv/config or a runtime that loads .env (Bun, node --env-file=.env, etc.).
  • Datasource URLs in schema.prisma — removed in favor of prisma.config.ts. SQLite URLs now resolve relative to the config file rather than the schema file.
  • prisma introspect — renamed to prisma db pull long ago. The old name is still mapped in packages/migrate/src/commands/DbPull.ts for back-compat.
  • Older test layoutspackages/client/src/__tests__/integration/happy/** and errors/** are flagged as legacy in TESTING.md. New tests are written as functional matrix tests in packages/client/tests/functional/.

Major rewrites

  • Esbuild-based build pipeline (~2022). Replaced an older tsc-driven build. The shared builder lives in helpers/compile/build.ts and produces dual CJS/ESM bundles plus type declarations.
  • Turborepo adoption (~2022). The root turbo.json defines build/dev task graphs; pipeline artifacts are cached.
  • Vitest migration (ongoing). The CLI package runs both Jest (legacy suites) and Vitest (new subcommand coverage); packages/cli/jest.config.js and packages/cli/vitest.config.ts coexist. Older packages are still pure Jest.
  • The Prisma 7 stack — see the era above. Largest single rewrite in the codebase's history.

Growth trajectory

Commit volume has been broadly stable (50–150 commits/month) throughout 2024–2026 with periodic spikes around release cycles. The package count grew significantly with the Prisma 7 rearchitecture (driver adapters, generator splits, new shared packages) and has been stable since.

Bots and automation account for ~31% of all-time commits. The largest single bot author is Prismo, the internal release bot that bumps engine versions.

See also

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

Lore – Prisma wiki | Factory