prisma-client-api

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

Updated Jul 21, 2026
One-click install
npx skills add https://github.com/8ReTid8/vitural_reality_test --skill prisma-client-api-8retid8
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-client-api
Source: https://github.com/8ReTid8/vitural_reality_test/tree/main/my-app/.windsurf/skills/prisma-client-api
Command: npx skills add https://github.com/8ReTid8/vitural_reality_test --skill prisma-client-api-8retid8

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. This Skill gives you an on-demand reference so you can write accurate CRUD operations, filters, relation queries, and transactions without leaving your workflow. ## Core Features & Use Cases - Model Query Reference: Covers all CRUD methods including findUnique, findMany, create, update, upsert, delete, count, aggregate, and groupBy with return types. - Filtering and Relations: Documents scalar operators, logical operators (AND, OR, NOT), relation filters (some, every, none, is), and nested writes. - Transactions and Raw SQL: Explains sequential and interactive $transaction patterns, isolation levels, and safe $queryRaw/$executeRaw usage with SQL injection prevention. - Use Case: When building a Next.js API route that needs a paginated, filtered user list with relation counts, consult this Skill to compose the correct findMany call with where, orderBy, take, skip, and _count options. ## Quick Start Ask the AI to write a Prisma query that finds all published posts with their authors, ordered by creation date and paginated by cursor.

Frequently Asked Questions about prisma-client-api

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

FAQPage Schema
How do I filter records with Prisma Client findMany?

Use the where option with filter operators like equals, contains, gt, lt, in, and logical operators AND, OR, NOT. Combine multiple conditions for implicit AND, or nest OR and NOT blocks for complex logic.

How to use transactions in Prisma Client?

Use prisma.$transaction with an array for sequential operations or an async callback for interactive transactions with dependent logic. Interactive transactions support options like maxWait, timeout, and isolationLevel such as Serializable.

What is the difference between select and include in Prisma?

select returns only the specified scalar fields, while include adds full related records to the result. Both support nesting for relations, but select and omit cannot be used together on the same query.

Does Prisma Client support raw SQL queries?

Yes, use $queryRaw for SELECT queries and $executeRaw for INSERT, UPDATE, or DELETE. Template literals parameterize values automatically to prevent SQL injection; avoid $queryRawUnsafe with untrusted input.

How do I paginate results with Prisma Client?

Use take and skip for offset pagination, or cursor with take for cursor-based pagination. For cursor pagination, pass the last record's unique field as the cursor and skip 1 to exclude it.

When should I use findUniqueOrThrow instead of findUnique?

Use findUniqueOrThrow when a missing record is an error condition, since it throws PrismaClientKnownRequestError instead of returning null. This is especially useful inside interactive transactions to trigger automatic rollback.