prisma-client-api

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

Updated Aug 17, 2026
One-click install
npx skills add https://github.com/Sahil-Showket/ShopSphere --skill prisma-client-api-sahil-showket
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prisma-client-api
Source: https://github.com/Sahil-Showket/ShopSphere/tree/main/services/product-service/.windsurf/skills/prisma-client-api
Command: npx skills add https://github.com/Sahil-Showket/ShopSphere --skill prisma-client-api-sahil-showket

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Developers writing database queries with Prisma Client often need to recall exact method signatures, filter operators, relation syntax, and transaction patterns, which slows down implementation and leads to incorrect query construction. ## 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, logical, relation, array, and JSON filter operators plus nested writes like connect, connectOrCreate, and disconnect. - 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 product service endpoint that needs paginated, filtered product listings with related categories, consult this skill to construct the correct findMany call with where, orderBy, take, skip, and include options. ## Quick Start Ask the AI to write a Prisma Client query that finds all published posts by a specific author with pagination and includes their comments.

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. For example, where: { age: { gte: 18 }, role: 'ADMIN' } returns adult admins, and you can combine conditions with relation filters like some, every, and none.

How to use transactions in Prisma Client?▼

Prisma supports sequential transactions via prisma.$transaction([op1, op2]) for independent operations and interactive transactions via prisma.$transaction(async (tx) => {...}) for dependent logic. Interactive transactions accept 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. You cannot combine select and omit on the same query, but you can nest select inside include or vice versa for fine-grained control over returned data.

Does Prisma Client support raw SQL queries safely?▼

Yes, $queryRaw and $executeRaw use tagged templates that automatically parameterize interpolated values, preventing SQL injection. Avoid $queryRawUnsafe with string concatenation of user input; use Prisma.sql, Prisma.join, and Prisma.raw only for trusted identifiers.

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 where the thrown error triggers an automatic rollback.