Skip to content
Prisma Client API Reference

Prisma Client API Reference Skill

Prisma's official Prisma Client reference skill: client setup with driver adapters, CRUD and bulk queries, select/include/omit, filters, relation reads and nested writes, transactions and safe raw SQL.

GitHub Docs

Install

Install with the skills CLI

One command for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf and dozens of other agents. Needs Node.js; the skill is fetched straight from prisma/skills.

$ npx skills add prisma/skills --skill prisma-client-api

Run it in a terminal. The CLI finds the agents installed on your machine, asks which ones to add the skill to, and whether to install it into the folder you ran it from or for all your projects.

Other ways to install

Copy the whole skill folder — SKILL.md and any scripts or references beside it — into ~/.claude/skills/prisma-client-api/, where Claude Code picks it up in every project. Only git is needed.

tmp=$(mktemp -d) && \
  git clone --depth 1 --branch main https://github.com/prisma/skills.git "$tmp" && \
  mkdir -p ~/.claude/skills && \
  cp -R "$tmp"/prisma-client-api ~/.claude/skills/prisma-client-api

No scripts or references next to it? Saving the SKILL.md alone as ~/.claude/skills/prisma-client-api/SKILL.md works too.

Using another agent? Its personal skills folder
Codex
~/.agents/skills/
Cursor
~/.cursor/skills/
GitHub Copilot
~/.copilot/skills/
Gemini CLI
~/.gemini/skills/
Windsurf
~/.codeium/windsurf/skills/
OpenCode
~/.config/opencode/skills/

About

  • Eight rule categories ranked by impact, each with a rule file
  • Client construction with driver adapters, logging and SQL commenter
  • CRUD, bulk operations, select/include/omit and pagination
  • Scalar, logical and relation filter operator tables
  • Array and interactive transactions; safe $queryRaw and $executeRaw

Prisma Client API Reference is Prisma's own skill for writing database code with Prisma ORM. It loads when an agent writes queries, performs create, read, update or delete operations, filters and sorts data, works with relations, uses transactions or configures the client, and it targets current Prisma (the 7.x line, using the prisma-client generator and driver adapters).

The skill is organised as eight rule categories ranked by impact, each with its own rule file: client construction (PrismaClient setup, adapter wiring such as @prisma/adapter-pg, logging and SQL commenter plugins), model queries (CRUD and bulk operations), query shape (select, include, omit, sorting and pagination), filters (scalar and logical operators), relations (relation reads and nested writes), transactions (array and interactive patterns), raw SQL (safe use of $queryRaw and $executeRaw) and client methods (lifecycle methods, extensions and satisfies patterns).

The SKILL.md itself carries a compact reference: client instantiation with an adapter, the table of model query methods, query options, client methods, quick examples for finding, creating, updating and deleting records and for transactions, plus tables of filter operators and relation filters. Model queries, transactions and raw SQL are marked critical, so an agent prioritises correctness and injection safety there.

It is aimed at TypeScript and JavaScript developers on Prisma ORM who want their coding agent to write current, idiomatic Prisma Client code rather than patterns from older versions. MIT licensed, from the prisma/skills repository.

SKILL.md

The instructions your agent loads, as published by Prisma.

SKILL.md
name
prisma-client-api
description
Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".
license
MIT
metadata
author: prisma version: "7.9.1"

Prisma Client API Reference

Complete API reference for Prisma Client. This skill provides guidance on model queries, filtering, relations, and client methods for current Prisma projects.

When to Apply

Reference this skill when:

  • Writing database queries with Prisma Client
  • Performing CRUD operations (create, read, update, delete)
  • Filtering and sorting data
  • Working with relations
  • Using transactions
  • Configuring client options
Rule Categories by Priority
PriorityCategoryImpactPrefix
1Client ConstructionHIGHconstructor
2Model QueriesCRITICALmodel-queries
3Query ShapeHIGHquery-options
4FilteringHIGHfilters
5RelationsHIGHrelations
6TransactionsCRITICALtransactions
7Raw SQLCRITICALraw-queries
8Client MethodsMEDIUMclient-methods
Quick Reference
  • constructor - PrismaClient setup, adapter wiring, logging, and SQL commenter plugins
  • model-queries - CRUD operations and bulk operations
  • query-options - select, include, omit, sort, pagination
  • filters - scalar and logical filter operators
  • relations - relation reads and nested writes
  • transactions - array and interactive transaction patterns
  • raw-queries - $queryRaw and $executeRaw safety
  • client-methods - lifecycle methods, extensions, and satisfies patterns for prisma-client
Client Instantiation
import { PrismaClient } from '../generated/client'
import { PrismaPg } from '@prisma/adapter-pg'

const adapter = new PrismaPg({
  connectionString: process.env.DATABASE_URL
})

const prisma = new PrismaClient({ adapter })
Model Query Methods
MethodDescription
findUnique()Find one record by unique field
findUniqueOrThrow()Find one or throw error
findFirst()Find first matching record
findFirstOrThrow()Find first or throw error
findMany()Find multiple records
create()Create a new record
createMany()Create multiple records
createManyAndReturn()Create multiple and return them
update()Update one record
updateMany()Update multiple records
updateManyAndReturn()Update multiple and return them
upsert()Update or create record
delete()Delete one record
deleteMany()Delete multiple records
count()Count matching records
aggregate()Aggregate values (sum, avg, etc.)
groupBy()Group and aggregate
Query Options
OptionDescription
whereFilter conditions
selectFields to include
includeRelations to load
omitFields to exclude
orderBySort order
takeLimit results
skipSkip results (pagination)
cursorCursor-based pagination
distinctUnique values only
Client Methods
MethodDescription
$connect()Explicitly connect to database
$disconnect()Disconnect from database
$transaction()Execute transaction
$queryRaw()Execute raw SQL query
$executeRaw()Execute raw SQL command
$on()Subscribe to events
$extends()Add extensions
Quick Examples
Find records
// Find by unique field
const user = await prisma.user.findUnique({
  where: { email: 'alice@prisma.io' }
})

// Find with filter
const users = await prisma.user.findMany({
  where: { role: 'ADMIN' },
  orderBy: { createdAt: 'desc' },
  take: 10
})
Create records
const user = await prisma.user.create({
  data: {
    email: 'alice@prisma.io',
    name: 'Alice',
    posts: {
      create: { title: 'Hello World' }
    }
  },
  include: { posts: true }
})
Update records
const user = await prisma.user.update({
  where: { id: 1 },
  data: { name: 'Alice Smith' }
})
Delete records
await prisma.user.delete({
  where: { id: 1 }
})
Transactions
const [user, post] = await prisma.$transaction([
  prisma.user.create({ data: { email: 'alice@prisma.io' } }),
  prisma.post.create({ data: { title: 'Hello', authorId: 1 } })
])
Rule Files

Detailed API documentation:

references/constructor.md        - PrismaClient constructor options
references/model-queries.md      - CRUD operations
references/query-options.md      - select, include, omit, where, orderBy
references/filters.md            - Filter conditions and operators
references/relations.md          - Relation queries and nested operations
references/transactions.md       - Transaction API
references/raw-queries.md        - $queryRaw, $executeRaw
references/client-methods.md     - $connect, $disconnect, $on, $extends
Filter Operators
OperatorDescription
equalsExact match
notNot equal
inIn array
notInNot in array
lt, lteLess than
gt, gteGreater than
containsString contains
startsWithString starts with
endsWithString ends with
modeCase sensitivity
Relation Filters
OperatorDescription
someAt least one related record matches
everyAll related records match
noneNo related records match
isRelated record matches (1-to-1)
isNotRelated record doesn't match
Resources
How to Use

Pick the category from the table above, then open the matching reference file for implementation details and examples.

Install

Prisma's official skill for migrating an ORM project from v6 to v7 - the prisma-client generator, driver adapters, prisma.config.ts, ESM entrypoints and every removed API.

Skill: Convex

by Convex

Featured

Convex's official top-level agent skill — routes an agent to the right convex-* skill for the task and to a served capability catalogue that stays current without a reinstall.

New

Convex's official skill for turning a one-sentence app idea into a running Next.js + Convex template with an anonymous dev deployment, plus strict rules for writing Convex functions that compile and push first time.

Browse all skills →