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/Soares-B/Livia-Lace --skill prisma-client-api-soares-b
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-client-api
Source: https://github.com/Soares-B/Livia-Lace/tree/main/livia-lace/.windsurf/skills/prisma-client-api
Command: npx skills add https://github.com/Soares-B/Livia-Lace --skill prisma-client-api-soares-b

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-type documentation. - Filtering and Relations: Documents scalar, logical, relation, array, and JSON filter operators plus nested writes, connectOrCreate, and relation counting. - Transactions and Raw SQL: Explains sequential and interactive $transaction patterns, isolation levels, and safe $queryRaw/$executeRaw usage with SQL injection prevention guidance. - Use Case: When building a Next.js API route that needs paginated, filtered user queries with related posts inside a transaction, the AI consults this reference to produce correct, type-safe Prisma Client code. ## Quick Start Ask the AI to write a Prisma query that finds all published posts with their authors, 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 write Prisma Client queries with filters and pagination?

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

How to use Prisma transactions for multiple database operations?

Use prisma.$transaction with an array for sequential independent operations, or pass an async function for interactive transactions with dependent logic. Interactive transactions support maxWait, timeout, and isolationLevel options like Serializable.

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

How do I include related records in a Prisma query?

Use the include option to load relations, or select for specific fields. Both support nesting, filtering with where, ordering, and limiting related records, plus _count for relation counts.

Why does Prisma findUnique return null and how to handle it?

findUnique returns null when no record matches the unique field. Use findUniqueOrThrow instead to throw a PrismaClientKnownRequestError automatically, which is useful inside transactions to trigger rollback.