prisma-client-api

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

2|Updated Aug 11, 2026
One-click install
npx skills add https://github.com/MahdiaMayati/spotlight --skill prisma-client-api-mahdiamayati
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prisma-client-api
Source: https://github.com/MahdiaMayati/spotlight/tree/main/spotlight-backend/.windsurf/skills/prisma-client-api
Command: npx skills add https://github.com/MahdiaMayati/spotlight --skill prisma-client-api-mahdiamayati

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. This Skill gives the AI a complete, structured Prisma Client API reference so it generates accurate database code instead of guessing at method names or operator syntax. ## Core Features & Use Cases - Model Query Reference: Covers all CRUD methods including findUnique, findMany, create, update, upsert, delete, count, aggregate, and groupBy with return-type documentation. - Filtering and Relations: Documents scalar operators, logical operators (AND/OR/NOT), relation filters (some/every/none/is), and nested write patterns 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 guidance. - Use Case: When you ask the AI to "write a query that finds all published posts by verified authors with pagination", it consults this reference to produce correct where, orderBy, take, and cursor syntax. ## Quick Start Ask the AI to write a Prisma query for your model, such as fetching filtered records with relations and pagination, and it will apply the correct API patterns from this reference.

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 notIn. Combine conditions with logical operators AND, OR, and NOT, and add orderBy, take, and skip for sorting and pagination.

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 accept maxWait, timeout, and isolationLevel options.

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 safely?▼

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

How do I query related records in Prisma?▼

Use include or select to load relations, and filter with relation operators some, every, none for to-many relations or is and isNot for one-to-one. Nested writes like connect, create, and connectOrCreate modify relations during mutations.

Why does Prisma raw query return BigInt for COUNT?▼

PostgreSQL returns BigInt for COUNT aggregations through raw queries. Convert the result with Number() before using it, and type the query result explicitly with a generic like $queryRaw<[{ count: bigint }]>.