prisma-client-api

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

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

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, and mistakes lead to runtime errors or unsafe SQL. ## Core Features & Use Cases - Model Query Reference: Covers CRUD methods like findUnique, findMany, create, update, upsert, delete, count, aggregate, and groupBy with return types. - Filtering and Relations: Documents scalar, logical, relation, array, and JSON filter operators plus nested writes and relation loading with select, include, and omit. - Transactions and Raw SQL: Explains sequential and interactive $transaction patterns, isolation levels, and safe $queryRaw/$executeRaw usage with SQL injection prevention. - Use Case: When building a Next.js API route that paginates users, filters by role, and creates related posts atomically, consult this reference to write the correct Prisma Client calls. ## Quick Start Ask the AI to write a Prisma Client query that finds published posts with their authors, ordered by creation date, using this skill's 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?

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 to use Prisma transactions for multiple operations?

Use prisma.$transaction with an array for sequential operations or an async callback for interactive transactions with dependent logic. Interactive transactions accept 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 and relations, while include adds all scalar fields plus the specified relations. You cannot combine select and omit on the same query, but include can be nested inside select.

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.sql and Prisma.join for dynamic query fragments.

How do I paginate results with Prisma Client?

Use take and skip for offset pagination, or cursor with take for cursor-based pagination. For cursor pagination, pass the last record's unique field as cursor and set skip: 1 to exclude the cursor record itself.

Why does Prisma raw query return BigInt for COUNT?

PostgreSQL returns BigInt for COUNT aggregations through raw queries. Convert the result with Number(result[0].count) before using it in JSON serialization or arithmetic operations.