Prisma is an open-source next-generation ORM (Object-Relational Mapping) that helps developers read and write data to the database in an intuitive, efficient, and safe way. It consists of the following parts:
- Prisma Client: Auto-generated and type-safe query builder for Node.js & TypeScript.
- Prisma Migrate: Migration system.
- Prisma Studio: GUI to view and edit data in your database.
Prisma Client is a query builder thats tailored to your schema. Its API is designed to be intuitive, both for SQL veterans and developers brand new to databases. The auto-completion helps you figure out your query without the need for documentation. Prisma provides the strongest type-safety guarantees of all the ORMs in the TypeScript ecosystem. Prisma Migrate auto-generates SQL migrations from your Prisma schema, and these migration files are fully customizable, giving you full control and ultimate flexibility — from local development to production environments. Prisma Studio is the easiest way to explore and manipulate data in your Prisma projects. You can understand your data by browsing across tables, filter, paginate, traverse relations, and edit your data with safety.
Prisma is a server-side library that can be used in any Node.js environment. It uses a custom Schema Definition Language (SDL) that automatically writes migrations and generates type-safe code. Unlike traditional ORMs, Prisma does not use classes or decorators for model definition. It instead uses code generation from schema, similar to the popular GraphQL Code Generator utility. This generated TypeScript code is used by the Prisma Client for stricter type safety and rich IDE auto-completion features.