prisma
Prisma is a next-generation Node.js and TypeScript ORM that provides a declarative data modeling language, auto-generated and type-safe query builder, and power…
Installation
npm install prisma @prisma/client
yarn add prisma @prisma/client
pnpm add prisma @prisma/client
Import
import { PrismaClient } from '@prisma/client';Quick Example
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
const user = await prisma.user.create({
data: { name: 'Alice', email: '[email protected]' },
});
const users = await prisma.user.findMany({
where: { name: { contains: 'Ali' } },
include: { posts: true },
});About prisma
Prisma is a next-generation Node.js and TypeScript ORM that provides a declarative data modeling language, auto-generated and type-safe query builder, and powerful migration system. Prisma's approach centers on the Prisma Schema — a human-readable file where you define your data models, relationships, and database configuration. From this schema, Prisma generates a fully type-safe client (PrismaClient) that provides autocompletion and compile-time error checking for all database operations. The generated client supports CRUD operations, relations, filtering, pagination, aggregation, transactions, and raw SQL when needed. Prisma Migrate generates SQL migrations from schema changes, maintaining a migration history for version-controlled schema evolution. Prisma supports PostgreSQL, MySQL, SQLite, SQL Server, MongoDB, and CockroachDB. Prisma Studio provides a visual GUI for browsing and editing database data. The type safety extends to relation queries — nested includes and selects are fully typed, catching missing or invalid field references at compile time. Prisma has become the most popular modern ORM for TypeScript applications, offering a developer experience that significantly reduces the likelihood of runtime database errors.
Quick Facts
| Package | prisma |
| Category | Database |
| Weekly Downloads | 4M+ |
| License | Apache-2.0 |
| Install | npm install prisma @prisma/client |
Related Packages
Drizzle ORM is a TypeScript ORM that provides a SQL-like query builder with full type safety, zero o…
TypeORM is a full-featured ORM for TypeScript and JavaScript that supports both Active Record and Da…
Sequelize is a promise-based Node.js ORM that supports PostgreSQL, MySQL, MariaDB, SQLite, and Micro…
pg (node-postgres) is the standard PostgreSQL client for Node.js, providing low-level access to Post…
mysql2 is a high-performance MySQL client for Node.js that provides prepared statements, non-UTF-8 e…
Browse npm Packages by Category
Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.