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/singhaditya73/Naviq --skill prisma-client-api-singhaditya73
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-client-api
Source: https://github.com/singhaditya73/Naviq/tree/main/packages/db/.agents/skills/prisma-client-api
Command: npx skills add https://github.com/singhaditya73/Naviq --skill prisma-client-api-singhaditya73

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. This Skill gives you an authoritative, versioned reference so you can write accurate queries the first time. ## Core Features & Use Cases - Complete Query Reference: Covers all model query methods (findUnique, findMany, create, update, upsert, delete, aggregate, groupBy) with return types and examples. - 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 SQL injection prevention. - Use Case: You need to paginate users, filter by role, and include their published posts. Consult the query-options and relations references to compose the correct findMany call with cursor pagination and filtered includes. ## Quick Start Ask the AI to write a Prisma query that finds all verified admin users with their five most recent published posts, ordered by creation date.

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

Use findMany with a where clause for filters and include or select for relations. Filter operators like equals, contains, in, gt, and logical AND/OR/NOT combine conditions, while relation filters some, every, and none match related records.

How do I 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 accept maxWait, timeout, and isolationLevel 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; use Prisma.sql, Prisma.join, and Prisma.raw for dynamic identifiers.

How do I instantiate PrismaClient with a driver adapter?

Create an adapter such as PrismaPg with your connection string and pass it to new PrismaClient({ adapter }). For development, use a global singleton pattern to prevent multiple instances during hot reloading in frameworks like Next.js.

What is the difference between select, include, and omit in Prisma?

select returns only specified fields, include adds related records to the result, and omit excludes specific fields like passwords. You cannot combine select and omit in the same query, but include can be nested inside select.

When should I use findUniqueOrThrow instead of findUnique?

Use findUniqueOrThrow when a missing record is an error condition, such as inside transactions where the thrown PrismaClientKnownRequestError triggers a rollback. findUnique returns null and suits cases where absence is acceptable.