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
Key Features
High Performance
High Performance
Written in Rust for maximum performance and memory safety. The query compiler generates optimized query plans that execute efficiently across all supported databases.
Multi-Database Support
Multi-Database Support
Native support for PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, CockroachDB, and MongoDB (via driver adapters).
Type-Safe Migrations
Type-Safe Migrations
Declarative schema migrations with automatic migration generation. The Schema Engine compares your Prisma schema with the current database state to generate migration files.
Driver Adapter Architecture
Driver Adapter Architecture
Modern architecture where query execution happens through TypeScript driver adapters, enabling support for serverless databases and edge runtimes.
Introspection
Introspection
Generate Prisma schemas from existing databases. The Schema Engine can reverse-engineer your database schema into a Prisma schema file.
WebAssembly Support
WebAssembly Support
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:| Database | Versions | Driver Adapters Available |
|---|---|---|
| PostgreSQL | 9.6, 10, 11, 12, 13, 14, 15, 16 | pg, neon, @prisma/adapter-pg |
| MySQL | 5.6, 5.7, 8.0+ | @prisma/adapter-mysql |
| MariaDB | 10.x+ | mariadb |
| SQL Server | 2017, 2019, 2022 | @prisma/adapter-mssql |
| SQLite | Latest | better-sqlite3, libsql |
| CockroachDB | 21.x+ | @prisma/adapter-pg-cockroachdb |
| PlanetScale | - | @prisma/adapter-planetscale |
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:- GitHub Repository - Source code and issues
- Prisma Documentation - User-facing documentation
- Discord Community - Get help and discuss
- Twitter - Latest updates and announcements