Prisma
By Prisma Data, Inc.
js and TypeScript that provides type-safe database queries, automatic migrations, and a declarative schema for modeling application data.
Definition
Prisma is a next-generation ORM for Node.js and TypeScript that provides type-safe database queries, automatic migrations, and a declarative schema for modeling application data.
Overview
Prisma replaces hand-written SQL or older ORM patterns with a declarative schema file that defines an application's data models, which Prisma then uses to generate a fully type-safe query client tailored to that exact schema. Because the generated client is aware of every model and field at compile time, TypeScript developers get autocomplete and type errors directly in their editor if a query references a field that doesn't exist, catching mistakes before runtime. Prisma Migrate handles the evolution of a database schema over time, generating and applying SQL migration files based on changes to the Prisma schema, which keeps a project's data model and its underlying database structure in sync without manually writing migration SQL. It supports major relational databases including PostgreSQL, MySQL, and SQLite, as well as MongoDB, giving teams flexibility in choosing their underlying data store while keeping the same developer-facing API. Prisma has become one of the most widely adopted ORMs in the modern Node.js and Next.js ecosystem, frequently chosen over alternatives like Sequelize or TypeORM for its stronger type safety and developer experience, and is commonly paired with hosted database platforms such as PlanetScale or Supabase.
Key Features
- Declarative schema file that models an application's data structures
- Auto-generated, fully type-safe query client for TypeScript and JavaScript
- Prisma Migrate for versioned, automatically generated database migrations
- Support for PostgreSQL, MySQL, SQLite, SQL Server, and MongoDB
- Prisma Studio, a visual editor for browsing and editing database data
- Relation queries with nested writes and includes handled type-safely
- Strong integration with Next.js and other modern Node.js frameworks