prisma-client-api

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

Updated Aug 20, 2026
One-click install
npx skills add https://github.com/rhorba/RestoLedger --skill prisma-client-api-rhorba
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-client-api
Source: https://github.com/rhorba/RestoLedger/tree/main/api/.windsurf/skills/prisma-client-api
Command: npx skills add https://github.com/rhorba/RestoLedger --skill prisma-client-api-rhorba

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 organized, example-rich reference so you can write accurate database queries without hunting through documentation. ## 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 operators, logical operators (AND/OR/NOT), relation filters (some/every/none), and 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: You need to paginate users, filter by role, include their published posts, and wrap a balance transfer in an interactive transaction. Open the matching reference file and copy the working pattern directly. ## 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, using cursor-based 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 findMany?

Use the where option with filter operators like equals, contains, gt, lt, in, and logical operators AND, OR, NOT. For example, where: { role: 'ADMIN', email: { contains: '@prisma.io' } } returns admins with matching emails.

How do I use Prisma transactions for multiple operations?

Use prisma.$transaction with an array for sequential 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 loads entire related records alongside all scalar fields. You cannot combine select and omit on the same query, but select and include can be nested within relations.

Does Prisma Client support raw SQL queries safely?

Yes, $queryRaw and $executeRaw use tagged templates that parameterize values automatically, preventing SQL injection. Avoid $queryRawUnsafe with string concatenation, and use Prisma.sql or Prisma.join for dynamic query fragments.

How do I paginate results with Prisma cursor pagination?

Combine take, skip, and cursor with orderBy. Fetch the first page with take: 10, then pass cursor: { id: lastId } with skip: 1 to continue from that record. Negative take values retrieve records in reverse.

Why does 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 it in standard JavaScript arithmetic or JSON serialization.