prisma-client-api

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

Updated Aug 21, 2026
One-click install
npx skills add https://github.com/Rithika135/watchtower-360 --skill prisma-client-api-rithika135
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-client-api
Source: https://github.com/Rithika135/watchtower-360/tree/main/watchtower360-backend/.windsurf/skills/prisma-client-api
Command: npx skills add https://github.com/Rithika135/watchtower-360 --skill prisma-client-api-rithika135

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 SQL injection risks. ## Core Features & Use Cases - Model Query Reference: Covers all CRUD methods including findUnique, findMany, create, update, upsert, deleteMany, 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 paginated user list with filtered relations in a Next.js app, consult the query-options and relations references to compose the correct select, include, cursor, and orderBy clauses. ## Quick Start Ask the AI to write a Prisma query that finds all published posts with their authors, ordered by creation date with cursor 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 with skip or cursor for pagination. For example, pass where: { role: 'ADMIN' }, orderBy: { createdAt: 'desc' }, and 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 for interactive transactions where later operations depend on earlier results. 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. You cannot combine select and omit on the same query, but select and include can be nested inside relation clauses.

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.

Why does my Prisma query fail with a relation filter error?

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