🗄️
Database4M+/wkApache-2.0

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
npm install prisma @prisma/client
yarn
yarn add prisma @prisma/client
pnpm
pnpm add prisma @prisma/client

Import

ESM
import { PrismaClient } from '@prisma/client';

Quick Example

usage
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

Packageprisma
CategoryDatabase
Weekly Downloads4M+
LicenseApache-2.0
Installnpm install prisma @prisma/client

Related Packages

Browse npm Packages by Category

Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.