prisma-client-api

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

Updated Jul 27, 2026
One-click install
npx skills add https://github.com/vasuguptadot-jpg/Life-xp- --skill prisma-client-api-vasuguptadot-jpg
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prisma-client-api
Source: https://github.com/vasuguptadot-jpg/Life-xp-/tree/main/attached_assets/LifeXP-Complete/apps/api/.agents/skills/prisma-client-api
Command: npx skills add https://github.com/vasuguptadot-jpg/Life-xp- --skill prisma-client-api-vasuguptadot-jpg

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 the AI a complete, structured reference so it generates accurate Prisma Client code on the first attempt. ## Core Features & Use Cases - Model Query Reference: Covers all CRUD methods including findUnique, findMany, create, update, upsert, delete, count, aggregate, and groupBy with return types. - Filtering and Relations: Documents scalar operators, logical operators (AND, OR, NOT), relation filters (some, every, none, is), and nested writes. - 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 needs paginated, filtered user queries with related posts inside a transaction, the AI can pull the exact syntax from the reference files instead of guessing. ## Quick Start Ask the AI to write a Prisma query that finds all published posts with their authors, ordered by creation date, using 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 write a Prisma findMany query with filters and pagination?▼

Use findMany with where for filters, orderBy for sorting, and take with skip or cursor for pagination. For example, pass where: { role: 'ADMIN' }, orderBy: { createdAt: 'desc' }, and take: 10 to get the ten most recent admins.

How do I use Prisma transactions for multiple operations?▼

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

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. Both support nesting for relations, but select and omit cannot be used together on the same query.

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

How do I filter Prisma queries by related records?▼

Use relation filters in the where clause: some matches records with at least one matching relation, every requires all to match, and none requires zero matches. For one-to-one relations, use is and isNot.

When should I use findUniqueOrThrow instead of findUnique?▼

Use findUniqueOrThrow when a missing record is an error condition, since it throws PrismaClientKnownRequestError instead of returning null. This is especially useful inside interactive transactions where the throw triggers a rollback.