| name | prisma |
| title | Prisma ORM |
| category | Backend & Data |
| description | Use to model a database with a type-safe schema, run migrations, and query from TypeScript/Node with the Prisma Client. |
| tags | ["orm","database","postgres","typescript","migrations","schema"] |
| official_docs | https://www.prisma.io/docs |
| sources | ["https://www.prisma.io/docs/getting-started/quickstart-sqlite","https://www.prisma.io/docs/orm/prisma-client/queries/crud","https://www.prisma.io/docs/orm/prisma-migrate/getting-started"] |
| last_verified | 2026-08-10T00:00:00.000Z |
Prisma ORM — Skillship
Type-safe database toolkit for Node/TypeScript: declare models in a schema, generate a fully typed
client, and evolve your database with versioned migrations.
🧭 When to use this skill
- Use when: you want end-to-end type safety between your DB and app code.
- Use when: you need a clear, versioned migration history (
prisma/migrations).
- Don't use for: raw ultra-hot paths where you need hand-tuned SQL (use
$queryRaw selectively).
⚡ Quickstart
1. Install & init
npm install prisma --save-dev
npm install @prisma/client
npx prisma init --datasource-provider postgresql
2. Configure env
DATABASE_URL="postgresql://user:pass@host:5432/dbname?schema=public"
3. Define a model
// prisma/schema.prisma
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
posts Post[]
}
model Post {
id Int @id @default(autoincrement())
title String
author User @relation(fields: [authorId], references: [id])
authorId Int
}
4. Migrate + generate
npx prisma migrate dev --name init
5. Query
import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
const user = await prisma.user.create({
data: { email: "alice@prisma.io", name: "Alice", posts: { : { : } } },
: { : },
});