prisma-client-api

Reference Prisma Client APIs for model queries, filters, relations, and transactions.

1|Updated Jun 5, 2026
One-click install
npx skills add https://github.com/sristigupta04/Airbnb-app --skill prisma-client-api-sristigupta04
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-client-api
Source: https://github.com/sristigupta04/Airbnb-app/tree/main/Full-stack/.agents/skills/prisma-client-api
Command: npx skills add https://github.com/sristigupta04/Airbnb-app --skill prisma-client-api-sristigupta04

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, relation patterns, and transaction options, and mistakes lead to runtime errors or inefficient database access. ## Core Features & Use Cases - Model Query Reference: Covers CRUD methods like findUnique, findMany, create, update, upsert, deleteMany, 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 paginates users, filters by role, and includes post counts, consult this skill to compose the correct findMany call with where, orderBy, take, skip, and _count select. ## Quick Start Ask the AI to write a Prisma query that finds all published posts by a specific author 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 filter records with Prisma Client findMany?

Use the where option with filter operators like equals, contains, in, gt, and lt, combined with logical operators AND, OR, and NOT. For example, where: { role: 'ADMIN', email: { contains: '@prisma.io' } } returns admins with matching emails.

How to use Prisma transactions for multiple operations?

Use prisma.$transaction with an array for sequential independent operations, or pass an async function 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, and you cannot combine select with omit on the same query.

Does Prisma Client support raw SQL queries safely?

Yes, $queryRaw and $executeRaw use tagged templates that parameterize values automatically, preventing SQL injection. Avoid $queryRawUnsafe with string concatenation, and use Prisma.sql and Prisma.join for dynamic query fragments.

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 cursor and set skip: 1 to exclude the cursor record itself.

Why does my Prisma query fail with relation filters?

Relation filters require the correct operator for the relation type: some, every, or none for to-many relations, and is or isNot for one-to-one relations. Using a to-many operator on a singular relation causes a validation error.