prisma-client-api

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

Updated Aug 7, 2026
One-click install
npx skills add https://github.com/Sambhav242005/Major-Project --skill prisma-client-api-sambhav242005
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-client-api
Source: https://github.com/Sambhav242005/Major-Project/tree/main/apps/web/.windsurf/skills/prisma-client-api
Command: npx skills add https://github.com/Sambhav242005/Major-Project --skill prisma-client-api-sambhav242005

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 APIs. This Skill gives you an on-demand reference so you can write accurate database queries without leaving your workflow or guessing at syntax. ## Core Features & Use Cases - Complete Query Reference: Covers all model query methods including findUnique, findMany, create, update, upsert, delete, count, aggregate, and groupBy with return types. - Filtering and Relations: Documents scalar and logical filter operators, relation filters (some, every, none, is), nested writes, and connect/disconnect patterns. - Transactions and Raw SQL: Explains sequential and interactive $transaction patterns, isolation levels, and safe $queryRaw/$executeRaw usage with SQL injection prevention. - Use Case: You need to paginate users with cursor-based pagination, filter by relation counts, and wrap a balance transfer in an interactive transaction. Load this Skill to get the exact syntax and best practices for each operation. ## Quick Start Ask the AI to write a Prisma query that finds all published posts with their authors, ordered by creation date, using 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 Prisma Client queries with filters and sorting?

Use the where option with filter operators like equals, contains, gt, and in, combined with orderBy for sorting. For example, prisma.user.findMany({ where: { role: 'ADMIN' }, orderBy: { createdAt: 'desc' }, take: 10 }) returns filtered, sorted, paginated results.

How to use Prisma transactions for multiple database 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. You cannot combine select and omit on the same query, but select and include can be nested within 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 of user input; use Prisma.sql and Prisma.join for dynamic query fragments.

Why does my Prisma query fail with relation filters?

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 the wrong operator or filtering on a missing relation field causes validation errors.