Prisma Client

Auto-generated, type-safe database client for Node.js and TypeScript.

Library
npm
v7.10.1
47,662 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
91 /100 Excellent
Development Activity 100
Maintenance 100
Community 64
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
85 /100 Excellent
Architecture 90
Code Quality 85
Innovation 88
Learning Curve 78

Prisma Client is the auto-generated, type-safe query builder at the heart of Prisma ORM. Instead of hand-writing SQL or wiring up a schema-less query builder, you define your data model once in a Prisma schema file, run prisma generate, and get back a fully-typed client tailored to your exact models, relations, and fields — with autocompletion for every query, filter, and result shape in your editor.

It ships as a thin runtime package: the generated client delegates the actual database work to a query engine (native Rust binary or WASM, or a JS driver adapter for edge/serverless runtimes), so the JavaScript/TypeScript surface stays small while still supporting PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, CockroachDB, and MongoDB through one consistent API.

What You Get

  • A fully-typed CRUD and relational query API generated directly from your Prisma schema, with autocompletion for models, fields, filters, and nested relations
  • First-class TypeScript types for every query result, including partial selects and included relations, so mismatched fields fail at compile time instead of runtime
  • Pluggable driver adapters (@prisma/adapter-pg, @prisma/adapter-neon, @prisma/adapter-libsql, etc.) for running in edge and serverless runtimes without the native query engine binary
  • A client extensions API ($extends) for adding custom methods, computed fields, query middleware, and result transformations without forking the generated client
  • Built-in support for interactive and sequential transactions, raw SQL escape hatches ($queryRaw/$executeRaw), and OpenTelemetry-based query tracing

Common Use Cases

  • Type-safe data access layer for REST, GraphQL, or gRPC backends built on Node.js or TypeScript
  • Database client for serverless and edge functions (Vercel, Cloudflare Workers, Netlify) via driver adapters instead of the native engine binary
  • Rapid CRUD scaffolding for full-stack frameworks like Next.js, where the generated types flow straight into API routes and server components
  • Multi-database projects that need one consistent query API across Postgres in production and SQLite in local development or tests

Under The Hood

Architecture: Prisma Client is generated code, not a static library — running prisma generate reads your schema.prisma (and, since v7, prisma.config.ts) and emits a client tailored to your exact data model into the packages/client output. At runtime, the published @prisma/client package (packages/client/src/runtime/getPrismaClient.ts, ~1,150 lines) wires together the generated model API with the DMMF (Data Model Meta Format, an AST of your schema shipped from the Rust/WASM query engine), a request pipeline, and a pluggable Engine interface. Query execution is delegated to either a native binary engine, a WASM query-compiler, or a JS driver adapter (@prisma/adapter-pg, -neon, -libsql, -d1, -planetscale, -mssql, -mariadb, -better-sqlite3) — the same generated client code runs against any of them, which is how Prisma supports both traditional Node servers and edge/serverless runtimes from one API surface.

Tech Stack: The whole client package is TypeScript (98.95% of the repo by bytes) built with a custom helpers/build.ts (via tsx), Jest for unit/functional tests, and pnpm workspaces (pnpm-workspace.yaml) tying together ~40 packages under packages/ — client, client-common, client-engine-runtime, client-generator-js/-ts, internals, migrate, engines, and the per-database adapter-* packages. @prisma/client’s own runtime dependency footprint is intentionally minimal (@prisma/client-runtime-utils as its only non-peer dependency), with prisma and typescript as optional peer dependencies — the generator and CLI tooling live in separate packages so the installed client stays lean.

Code Quality: The client package has substantial automated test coverage — 49+ .test.ts files under packages/client/src/__tests__ covering DMMF parsing, raw-parameter serialization/deserialization, log-level resolution, type declarations, and dedicated types/ and integration/ suites, run through Jest with dotenv-loaded database credentials for integration tests and a separate test:functional harness for cross-database behavior. Source is organized by concern under src/runtime/core/ (engines, extensions, transaction, tracing, jsonProtocol, errors, model), which keeps the large runtime file (getPrismaClient.ts) focused on orchestration rather than implementation detail.

API Design: The generated API mirrors your schema directly — prisma.user.findMany({ where, include }) — so there’s near-zero boilerplate between defining a model and querying it, and results are typed down to the exact shape of the select/include you passed. The $extends mechanism and typed raw-SQL helpers (sql template tag, $queryRaw) give escape hatches without breaking type safety, and the required prisma generate step (rather than a fully dynamic client) is the main learning-curve cost, since it means the client is only ever as current as your last generate.

Used by 76 apps in this directory

TypeScript
99%
Other

Teable

Databases · No Code Platforms

21,920

A no-code PostgreSQL database with spreadsheet UX, real-time collaboration, and native AI agents — built for teams that outgrow Airtable.

View details
78
Repo Health
76
Technical
62
Dependency
Built with
TypeScript 99%
Updated 1 weeks ago
TypeScript
98%
Apache 2.0

Tianji

Analytics · Monitoring

3,119

Replace Google Analytics, UptimeKuma, and Prometheus with one self-hosted platform that tracks websites, monitors uptime, and reports server health.

View details
86
Repo Health
76
Technical
64
Dependency
Built with
TypeScript 98%
Updated 1 weeks ago
Rust
71%
MIT

Trieve

AI Development · Developer Tools · Search

2,721

All-in-one self-hostable platform for hybrid search, RAG, recommendations, and analytics built on Rust and Qdrant.

View details
42
Repo Health
74
Technical
65
Dependency
Built with
Rust 71%
Updated 9 months ago
TypeScript
99%
Apache 2.0

Trigger.dev

AI Development · Automation · Developer Tools

16,606

Build and deploy fully-managed AI agents and background jobs in TypeScript — with no timeouts, durable retries, real-time observability, and elastic scaling built in.

View details
90
Repo Health
9
Technical
63
Dependency
Built with
TypeScript 99%
Updated 6 days ago
TypeScript
99%
Apache 2.0

Trigger.dev

AI Development · Automation · Developer Tools

16,606

Build and deploy fully-managed AI agents and background jobs in TypeScript — with no timeouts, durable retries, real-time observability, and elastic scaling built in.

View details
90
Repo Health
9
Technical
63
Dependency
Built with
TypeScript 99%
Updated 6 days ago
TypeScript
65%
Other

Typebot

AI Assistants · AI Development · Developer Tools

10,576

Build sophisticated chatbots visually, embed them anywhere without iframes, and own your data — fully self-hostable with a modular block system and 30+ integrations.

View details
94
Repo Health
82
Technical
64
Dependency
Built with
TypeScript 65%
MDX 34%
Updated 1 weeks ago
TypeScript
65%
Other

Typebot

AI Assistants · AI Development · Developer Tools

10,576

Build sophisticated chatbots visually, embed them anywhere without iframes, and own your data — fully self-hostable with a modular block system and 30+ integrations.

View details
94
Repo Health
82
Technical
64
Dependency
Built with
TypeScript 65%
MDX 34%
Updated 1 weeks ago
TypeScript
65%
Other

Typebot

AI Assistants · AI Development · Developer Tools

10,576

Build sophisticated chatbots visually, embed them anywhere without iframes, and own your data — fully self-hostable with a modular block system and 30+ integrations.

View details
94
Repo Health
82
Technical
64
Dependency
Built with
TypeScript 65%
MDX 34%
Updated 1 weeks ago
TypeScript
65%
Other

Typebot

AI Assistants · AI Development · Developer Tools

10,576

Build sophisticated chatbots visually, embed them anywhere without iframes, and own your data — fully self-hostable with a modular block system and 30+ integrations.

View details
94
Repo Health
82
Technical
64
Dependency
Built with
TypeScript 65%
MDX 34%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers