Skip to main content
Prisma Engines Hero Light

What are Prisma Engines?

Prisma Engines is a collection of high-performance engines that power the core stack for Prisma, including Prisma Client and Prisma Migrate. Built in Rust for speed and reliability, these engines handle query compilation, database migrations, schema introspection, and more.
If you’re looking to install Prisma or use the engines in your application, check out the Getting Started guide in the main Prisma documentation.

Core Components

Query Compiler

Compiles Prisma Client queries into executable plans (SQL + orchestration) that run through driver adapters in JavaScript

Schema Engine

Creates and runs migrations, performs introspection, and manages database schemas

Driver Adapters

TypeScript utilities that load query plans, communicate with database drivers, and expose compatibility protocols

Prisma Format

Formatter and LSP (Language Server Protocol) implementation for Prisma schema files

Prisma Schema Language (PSL)

The Prisma Schema Language defines the data structures and parsing rules for Prisma schema files, including available database connectors. PSL is used throughout:
  • Schema Engine for migrations and introspection
  • Prisma Format for formatting and language server features
  • Query Compiler via the DataModel (DML), an annotated version of PSL
model User {
  id        Int      @id @default(autoincrement())
  email     String   @unique
  name      String?
  posts     Post[]
  createdAt DateTime @default(now())
}

model Post {
  id        Int      @id @default(autoincrement())
  title     String
  content   String?
  published Boolean  @default(false)
  author    User     @relation(fields: [authorId], references: [id])
  authorId  Int
}

Key Features

Written in Rust for maximum performance and memory safety. The query compiler generates optimized query plans that execute efficiently across all supported databases.
Native support for PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, CockroachDB, and MongoDB (via driver adapters).
Declarative schema migrations with automatic migration generation. The Schema Engine compares your Prisma schema with the current database state to generate migration files.
Modern architecture where query execution happens through TypeScript driver adapters, enabling support for serverless databases and edge runtimes.
Generate Prisma schemas from existing databases. The Schema Engine can reverse-engineer your database schema into a Prisma schema file.
Query compiler and schema engine components available as WebAssembly modules for browser and edge runtime compatibility.

Repository Structure

The prisma-engines repository contains:
  • Query Compiler (query-compiler/) - Query planning and compilation logic
  • Schema Engine (schema-engine/) - Migration and introspection engine
  • PSL (psl/) - Prisma Schema Language parser and validator
  • Driver Adapters (libs/driver-adapters/) - Rust-side adapter utilities
  • Prisma Format (prisma-fmt/) - Schema formatter and LSP server
  • Libraries (libs/) - Shared utilities, error handling, connectors, and more
  • Quaint (quaint/) - Database abstraction layer

Supported Databases

Prisma Engines supports multiple database systems:
DatabaseVersionsDriver Adapters Available
PostgreSQL9.6, 10, 11, 12, 13, 14, 15, 16pg, neon, @prisma/adapter-pg
MySQL5.6, 5.7, 8.0+@prisma/adapter-mysql
MariaDB10.x+mariadb
SQL Server2017, 2019, 2022@prisma/adapter-mssql
SQLiteLatestbetter-sqlite3, libsql
CockroachDB21.x+@prisma/adapter-pg-cockroachdb
PlanetScale-@prisma/adapter-planetscale
MongoDB support is currently in development for the Query Compiler architecture. MongoDB will be added once a driver adapter is available.

Next Steps

Architecture

Learn about the internal architecture and how components work together

Getting Started

Build and run the engines locally for development

Development Guide

Learn how to contribute and develop features for Prisma Engines

API Documentation

Browse the complete API documentation generated from source code

Community and Support

Prisma Engines is open source and actively maintained. Join the community:

Build docs developers (and LLMs) love