prisma-client-api

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

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

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 transaction patterns, and mistakes lead to runtime errors or inefficient database access. ## Core Features & Use Cases - Model Query Reference: Covers CRUD operations like findUnique, findMany, create, update, upsert, delete, plus aggregation and groupBy. - Filtering and Relations: Documents scalar and logical filter operators, relation filters (some, every, none), and nested writes. - Transactions and Raw SQL: Explains sequential and interactive $transaction patterns plus safe $queryRaw and $executeRaw usage. - Use Case: When building a Next.js API route that needs paginated, filtered user queries with related posts inside a transaction, consult this skill to write correct Prisma Client code. ## Quick Start Ask the AI to write a Prisma query that finds all published posts by a given author with pagination and include the author relation.

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 pagination?

Use findMany with a where clause for filters, orderBy for sorting, and take with skip or cursor for pagination. Filter operators include equals, contains, gt, lt, in, and logical operators AND, OR, NOT.

How to use Prisma transactions for multiple operations?

Use prisma.$transaction with an array for sequential independent operations, or pass an async function for interactive transactions where later operations depend on earlier results. Interactive transactions support maxWait, timeout, and isolationLevel options.

Does Prisma Client support raw SQL queries safely?

Yes, $queryRaw and $executeRaw use tagged templates that parameterize interpolated values automatically, preventing SQL injection. Avoid $queryRawUnsafe with string concatenation, and use Prisma.raw only for trusted identifiers like column names.

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.

Why does my Prisma query fail with a connection error in Next.js?

Next.js hot reloading creates multiple PrismaClient instances that exhaust database connections. Use the singleton pattern that caches the client on globalThis in development so only one instance persists across reloads.