prisma-client-api

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

Updated Aug 9, 2026
One-click install
npx skills add https://github.com/mousetailor/doker_and_cd_pipeline --skill prisma-client-api-mousetailor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-client-api
Source: https://github.com/mousetailor/doker_and_cd_pipeline/tree/main/packages/db/.agents/skills/prisma-client-api
Command: npx skills add https://github.com/mousetailor/doker_and_cd_pipeline --skill prisma-client-api-mousetailor

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 you an authoritative, versioned reference so you write accurate database queries without guessing API signatures or digging through external docs. ## Core Features & Use Cases - Complete Query Reference: Covers all model query methods (findUnique, findMany, create, update, upsert, delete, aggregate, groupBy) with return types and code examples. - Filtering and Relations: Documents scalar and logical filter operators, relation filters (some, every, none, is), nested writes, and connect/create 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. Open the matching reference file and copy the correct pattern directly. ## 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 conditional 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 can nest select inside include or vice versa, 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 and Prisma.join for dynamic query fragments instead.

How do I filter Prisma queries by related records?

Use relation filters: some matches when at least one related record qualifies, every requires all to match, and none requires zero matches. For one-to-one relations, use is and isNot, such as where: { posts: { some: { published: true } } }.

Why does my Prisma raw query return BigInt for COUNT?

PostgreSQL returns BigInt for COUNT aggregations in raw queries. Type the result as bigint and convert with Number(result[0].count) before using the value in standard JavaScript arithmetic or JSON serialization.