prisma-client-api

Reference Prisma Client API for queries, filters, relations, and transactions.

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

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, and relation patterns; this Skill provides a structured API reference so you write accurate database code without guessing syntax. ## Core Features & Use Cases - CRUD Query Reference: Covers findUnique, findMany, create, update, upsert, delete, and bulk operations with return-type tables. - Filtering and Relations: Documents scalar operators, logical AND/OR/NOT, relation filters (some, every, none), and nested writes. - Transactions and Raw SQL: Explains sequential and interactive $transaction patterns plus safe $queryRaw usage with SQL injection guidance. - Use Case: When implementing a NestJS service backed by PostgreSQL, consult this Skill to write a paginated findMany query with filtered includes and wrap dependent writes in an interactive transaction. ## Quick Start Ask the AI to write a Prisma query that finds users filtered by role with their published posts included, using this Skill as the API 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?

Pass a where object to findMany with field conditions like { role: 'ADMIN' } or operators such as contains, gte, and in. Combine conditions with AND, OR, and NOT for complex logic, and add orderBy, take, and skip for sorting and pagination.

How to use Prisma transactions for dependent operations?

Use the interactive form prisma.$transaction(async (tx) => {...}) when operations depend on each other or need conditional logic. Use the array form prisma.$transaction([op1, op2]) for simple sequential batches; both roll back entirely on failure.

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. They can be combined at nested levels, 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; use Prisma.sql, Prisma.join, and Prisma.raw for dynamic fragments.

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 throw triggers an automatic rollback.