prisma-client-api

Provides Prisma Client API reference for queries, filters, relations, and transactions.

Updated Aug 19, 2026
One-click install
npx skills add https://github.com/nethangabrielb/tasks-app-practical-exam --skill prisma-client-api-nethangabrielb
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prisma-client-api
Source: https://github.com/nethangabrielb/tasks-app-practical-exam/tree/main/packages/database/.agents/skills/prisma-client-api
Command: npx skills add https://github.com/nethangabrielb/tasks-app-practical-exam --skill prisma-client-api-nethangabrielb

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing correct Prisma Client queries requires knowing dozens of methods, filter operators, and transaction patterns, and mistakes lead to runtime errors or inefficient database access. This Skill gives you an authoritative, versioned reference so you can write accurate CRUD operations, filters, relation queries, and transactions on the first attempt. ## Core Features & Use Cases - Complete Query Reference: Covers all model query methods (findUnique, findMany, create, update, upsert, delete, aggregate, groupBy) with return types and examples. - Filtering & Relations: Documents scalar, logical, relation, array, and JSON filter operators plus nested writes like connect, connectOrCreate, and disconnect. - Transactions & Raw SQL: Explains sequential and interactive $transaction patterns, isolation levels, and safe $queryRaw/$executeRaw usage with SQL injection prevention. - Use Case: While building a NestJS endpoint that paginates tasks and filters by completion status, consult this Skill to compose the correct findMany call with where, orderBy, take, skip, and cursor options. ## Quick Start Ask the AI to write a Prisma query that finds all incomplete tasks containing a keyword, ordered by creation date with pagination.

Frequently Asked Questions about prisma-client-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a Prisma findMany query with filters and pagination?▼

Use prisma.model.findMany with a where clause for filters, orderBy for sorting, and take/skip or cursor for pagination. For example, pass where: { role: 'ADMIN' }, orderBy: { createdAt: 'desc' }, take: 10 to get the ten newest admins.

How do I use Prisma transactions for multiple operations?▼

Use prisma.$transaction with an array for independent sequential operations, or pass an async function receiving a tx client for dependent logic with conditional checks. Interactive transactions accept maxWait, timeout, and isolationLevel options.

What is the difference between select, include, and omit in Prisma?▼

select returns only the specified fields, include loads related records alongside all scalar fields, and omit excludes specific fields from the result. You cannot combine select and omit in the same query.

Does Prisma Client support raw SQL queries safely?▼

Yes, $queryRaw and $executeRaw use tagged templates that parameterize interpolated values, preventing SQL injection. Avoid $queryRawUnsafe with string concatenation, and use Prisma.raw only for trusted identifiers like column names.

How do I filter Prisma queries by related records?▼

Use relation filter operators in the where clause: some matches at least one related record, every requires all to match, and none requires zero matches. For one-to-one relations, use is and isNot.

Why should I use a singleton pattern for PrismaClient in development?▼

Hot-reloading in development frameworks creates a new PrismaClient on each reload, exhausting database connections. Storing the client on globalThis ensures one instance persists across module reloads.