prisma-client-api

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

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/RavitejaKarra24/dotfiles --skill prisma-client-api-ravitejakarra24
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-client-api
Source: https://github.com/RavitejaKarra24/dotfiles/tree/main/agents/.agents/skills/prisma-client-api
Command: npx skills add https://github.com/RavitejaKarra24/dotfiles --skill prisma-client-api-ravitejakarra24

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, and mistakes like SQL injection in raw queries or missing rollback logic cause production bugs. ## Core Features & Use Cases - Model Query Reference: Covers all CRUD methods including findUnique, findMany, createManyAndReturn, upsert, aggregate, and groupBy with return-type tables. - Filtering and Relations: Documents scalar operators, logical AND/OR/NOT combinations, relation filters (some, every, none, is), and nested writes like connectOrCreate and disconnect. - Transactions and Raw SQL: Explains sequential versus interactive $transaction patterns, isolation levels, and safe $queryRaw usage with parameterization to prevent SQL injection. - Use Case: When building a paginated user list filtered by role with post counts, consult the query-options and relations references to compose select, orderBy, cursor pagination, and _count correctly on the first attempt. ## Quick Start Ask the AI to write a Prisma query that finds all verified users with at least one published post, 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 filter records with Prisma Client where clauses?

Prisma Client filters use the where option with operators like equals, contains, gt, lt, in, and notIn. Combine conditions with logical operators AND, OR, and NOT, and use relation filters like some, every, and none for related records.

How to use Prisma transactions for multiple operations?

Prisma supports sequential transactions via an array passed to $transaction, and interactive transactions via an async callback receiving a scoped tx client. Interactive transactions support conditional logic, rollback on thrown errors, and options like timeout and isolationLevel.

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.raw only for trusted identifiers like column names.

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.