Open-Source Wikis

/

Prisma

/

Prisma overview

/

Getting started

prisma/prisma

Getting started

This page covers how to bring up prisma/prisma for development. End-user install instructions live at prisma.io/docs — what follows is for contributors working on the monorepo.

Prerequisites

From package.json and CONTRIBUTING.md:

  • Node.js ^20.19 || ^22.12 || >=24.0 (latest LTS recommended; nvm is the recommended version manager)
  • pnpm >=10.15 <11 (the preinstall hook in package.json rejects npm/yarn via scripts/only-allow-pnpm.js)
  • Docker — required for any test that hits a real database (managed via docker/docker-compose.yml)
  • Unix-like shellbash/zsh on Linux or macOS, or WSL/Dev Containers on Windows. Pure Windows is not officially supported.

Bootstrap

git clone https://github.com/prisma/prisma.git
cd prisma
pnpm install
pnpm -r run dev      # builds every package without running tsc (fastest)

Other root-level build modes:

Command What it does
pnpm build turbo build — full dependency-ordered build with type emit
pnpm dev turbo dev — builds without tsc (faster, no .d.ts updates)
pnpm watch one-shot dev build, then esbuild watch mode for everything in parallel
pnpm clean git clean -fdx excluding sandbox, .envrc.local, and the docker override

The build pipeline is documented in helpers/compile/build.ts; package-level builders typically just call into that with package-specific config (see packages/<pkg>/helpers/build.ts).

Per-package work

Most contribution loops are package-scoped:

cd packages/client
pnpm run dev               # build this package only
pnpm run test <pattern>    # run tests matching pattern (Jest or Vitest)

Or, from the root, target a single workspace:

pnpm --filter @prisma/client test:functional:code
pnpm --filter @prisma/client test:e2e --verbose --runInBand
pnpm --filter prisma test

pnpm --filter <name> <script> is the canonical way to invoke any package's scripts.

Test databases

Many tests require live databases. Bring them up with:

docker compose -f docker/docker-compose.yml up -d

This launches PostgreSQL, MySQL/MariaDB, MS SQL Server, and MongoDB (with replica set init). See docker/README.md for credentials and ports. Connection details live in .db.env at the repo root and are loaded automatically by the test scripts (pnpm test is wrapped in dotenv -e ../../.db.env).

Sandbox: try Prisma against a real schema

For exploratory work and reproductions, the sandbox/ directory contains pre-wired starter projects that link directly against the local packages:

cd sandbox
cp -r basic-sqlite my-repro
cd my-repro
pnpm install
pnpm dbpush
pnpm generate && pnpm start

In any successful sandbox setup, pnpm prisma -v prints version 0.0.0 (the workspace version).

Linting, formatting, and type checking

Command Purpose
pnpm lint ESLint over the entire repo (eslint.config.cjs)
pnpm lint-fix ESLint with --fix
pnpm format Prettier write
pnpm prettier-check Prettier check (no writes)

ESLint uses both upstream rules and project-local rules in eslint-local-rules/. Lint-staged runs Prettier and ESLint on every commit via Husky (.husky/).

Benchmarks

pnpm bench [pattern] runs Benchmark.js suites across packages and writes results to output.txt. CodSpeed tracks history through .github/workflows/benchmark.yml. See docs/benchmarking.md for benchmark locations.

Where to go next

  • Development workflow for branch / PR / merge expectations
  • Testing for the full test taxonomy (Jest unit, Vitest, functional matrix, e2e, integration)
  • Tooling for esbuild config, Turborepo, and ESLint plugins
  • AGENTS.md — the canonical agent-facing knowledge base, kept current by contributors as they learn the codebase

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

Getting started – Prisma wiki | Factory