옵션
집 Skill 웹 개발 prisma-client-api

prisma-client-api

prisma/skills prisma/skills

모델 쿼리, 필터, 연산자 및 클라이언트 메서드를 다루는 Prisma Client API 참조 문서입니다. 데이터베이스 쿼리를 작성하거나, CRUD 작업을 수행하거나, 데이터를 필터링하거나, Prisma Client를 구성할 때 사용하십시오. “prisma query”, “findMany”, “create”, “update”, “delete”, “$transaction”에 대한 트리거.

...모든 것을 확장하십시오
59
업데이트 된 시간 2026년 6월 29일

prisma-client-api 소개

prisma-client-api 스킬은 Prisma Client를 사용하여 데이터베이스와 상호작용하는 데 필요한 포괄적인 참고 자료를 제공합니다. 이 스킬은 Prisma 프로젝트 내에서 쿼리 작성, CRUD 작업 수행, 필터 적용, 관계 관리 및 트랜잭션 처리를 간소화합니다. 이 스킬은 클라이언트 인스턴스화, 모델 쿼리, 쿼리 옵션 및 원시 SQL 실행에 대한 상세한 지침을 제공함으로써, 개발자가 관계형 데이터베이스를 다룰 때 오류를 줄이고 효율성을 높일 수 있도록 돕습니다. 특히 쿼리가 올바르게 구성되었는지 확인하고, 중첩 쓰기나 트랜잭션과 같은 고급 작업이 안전하고 효과적으로 처리되도록 하는 데 유용합니다.

이 스킬은 findUnique, findMany, create, update, delete, upsert와 같은 모델 쿼리 메서드와 count, aggregate, groupBy와 같은 집계 함수를 포함한 광범위한 기능을 다룹니다. 또한 쿼리 옵션에 대한 포괄적인 지원을 제공하여, 개발자가 필터링, 선택, 포함, 생략, 정렬, 페이지 분할 및 고유 값 적용을 수행할 수 있도록 합니다. 라이프사이클 관리, 이벤트 구독, 원시 SQL 실행 및 클라이언트 확장을 위한 Prisma Client 메서드도 포함되어 있습니다. 이 스킬은 원시 SQL 쿼리의 안전한 실행을 보장하며, 데이터 무결성을 유지하기 위해 배열 기반 및 대화형 트랜잭션 사용에 대한 지침을 제공합니다.

대상 사용자는 Prisma를 통해 데이터베이스와 효율적으로 상호작용해야 하는 JavaScript 또는 TypeScript를 사용하는 백엔드 개발자, 데이터베이스 관리자, 풀스택 엔지니어입니다. 대표적인 사용 사례로는 정확한 데이터 검색, 조작 및 집계가 중요한 웹 애플리케이션, API 및 마이크로서비스 구축이 있습니다. 또한 프로덕션 환경에서 복잡한 관계형 로직을 구현하거나 일괄 처리를 수행할 때 일관된 쿼리 패턴과 모범 사례에 대한 표준 참조 자료가 필요한 팀에게도 적합합니다.

자주 묻는 질문

사용자 정의 어댑터를 사용하여 Prisma Client를 인스턴스화하려면 어떻게 해야 합니까?

제공된 TypeScript 예제에서 볼 수 있듯이, PrismaClient와 해당 어댑터를 임포트한 다음, 어댑터 구성을 클라이언트 생성자에 전달하여 Prisma Client를 인스턴스화할 수 있습니다.

Prisma Client는 어떤 데이터베이스 작업을 지원하나요?

Prisma Client는 findUnique, findMany, create, createMany, update, updateMany, upsert, delete, deleteMany를 포함한 모든 CRUD 작업을 지원합니다. 또한 집계 및 그룹화 메서드도 지원합니다.

Prisma Client는 트랜잭션을 처리할 수 있나요?

네, Prisma Client는 $transaction 메서드를 사용하여 배열 기반 트랜잭션과 대화형 트랜잭션을 모두 지원하므로, 단일 트랜잭션 내에서 여러 쿼리를 안전하게 실행할 수 있습니다.

원시 SQL이 지원되며 안전하게 사용할 수 있나요?

Prisma Client는 원시 SQL 쿼리를 실행하기 위한 $queryRaw 및 $executeRaw 메서드를 제공합니다. SQL 인젝션을 방지하기 위해 이 메서드들을 신중하게 사용해야 하며, 문서에는 안전한 사용법에 대한 지침이 포함되어 있습니다.

이 Prisma Client API 스킬을 사용하려면 어떤 조건이 필요한가요?

생성된 클라이언트가 포함된 Prisma 프로젝트, 지원되는 데이터베이스, 그리고 적절한 어댑터가 필요합니다. 클라이언트 인스턴스 생성 및 쿼리 실행을 위해서는 TypeScript 또는 JavaScript 환경이 필요합니다.

GitHub에서 보기

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 fieldconst user = await prisma.user.findUnique({  where: { email: '[email protected]' }})// Find with filterconst users = await prisma.user.findMany({  where: { role: 'ADMIN' },  orderBy: { createdAt: 'desc' },  take: 10})

Create records

const user = await prisma.user.create({  data: {    email: '[email protected]',    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: '[email protected]' } }),  prisma.post.create({ data: { title: 'Hello', authorId: 1 } })])

Rule Files

Detailed API documentation:

references/constructor.md        - PrismaClient constructor optionsreferences/model-queries.md      - CRUD operationsreferences/query-options.md      - select, include, omit, where, orderByreferences/filters.md            - Filter conditions and operatorsreferences/relations.md          - Relation queries and nested operationsreferences/transactions.md       - Transaction APIreferences/raw-queries.md        - $queryRaw, $executeRawreferences/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

  • Prisma Client API Reference
  • CRUD Operations
  • Filtering and Sorting

How to Use

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

prisma-client-api 설치

스킬 파일을 다운로드하여 .claude/skills/ 디렉터리에 압축을 풀어주세요.

ZIP 다운로드

저장소를 클론하고 스킬 파일을 프로젝트에 복사하세요.

git clone https://github.com/prisma/skills/blob/main/prisma-client-api/SKILL.md # Copy SKILL.md to your .claude/skills/ directory

복사 복사
빠른 설정: skill 폴더를 .claude/skills/로 복사하면 Claude가 해당 스킬을 자동으로 감지하여 사용합니다.
저장소 prisma/skills

관련 스킬

github-code-search
업데이트 된 시간 2026년 6월 29일
drizzle-orm
업데이트 된 시간 2026년 6월 29일
clickhouse-io
업데이트 된 시간 2026년 6월 29일
coding-standards
업데이트 된 시간 2026년 6월 29일
OR