prisma-client-api

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

Updated Jun 11, 2026
One-click install
npx skills add https://github.com/brillianodhiya/VisionScript --skill prisma-client-api-brillianodhiya
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prisma-client-api
Source: https://github.com/brillianodhiya/VisionScript/tree/main/.agents/skills/prisma-client-api
Command: npx skills add https://github.com/brillianodhiya/VisionScript --skill prisma-client-api-brillianodhiya

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 SQL injection risks. ## Core Features & Use Cases - Model Query Reference: Covers CRUD methods like findUnique, findMany, create, update, upsert, deleteMany, count, aggregate, and groupBy with return types. - Filtering and Relations: Documents scalar, logical, relation, array, and JSON filter operators plus 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 parameterization. - Use Case: When building a Next.js API route that paginates users, filters by role, and includes post counts, consult this reference to compose the correct findMany call with where, orderBy, take, skip, and _count options. ## Quick Start Ask the AI to write a Prisma Client query that finds all published posts by a given author, 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 findMany?▼

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

How to use transactions in Prisma Client?▼

Prisma supports sequential transactions via prisma.$transaction([op1, op2]) and interactive transactions via prisma.$transaction(async (tx) => {...}). Interactive transactions allow dependent operations and conditional logic, with options for maxWait, timeout, and isolationLevel.

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 inside relation options.

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 of user input; use Prisma.sql, Prisma.join, and Prisma.raw for dynamic fragments.

Why does Prisma create multiple client instances in Next.js development?▼

Next.js hot reloading re-executes modules, creating a new PrismaClient on each reload and exhausting database connections. Store the client on globalThis in a singleton pattern so the instance persists across reloads in development.

When should I use upsert instead of create in Prisma?▼

Use upsert when a record may already exist and you want to update it or create it otherwise, keyed by a unique field. It takes where, update, and create arguments, avoiding separate existence checks and race conditions.