prisma-client-api

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

Updated Aug 1, 2026
One-click install
npx skills add https://github.com/jpmartirez/kilatis --skill prisma-client-api-jpmartirez
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-client-api
Source: https://github.com/jpmartirez/kilatis/tree/main/frontend/.windsurf/skills/prisma-client-api
Command: npx skills add https://github.com/jpmartirez/kilatis --skill prisma-client-api-jpmartirez

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 vulnerabilities. This Skill gives you an authoritative, structured reference so you can write accurate database queries on the first attempt. ## Core Features & Use Cases - Complete CRUD Reference: Covers findUnique, findMany, create, update, upsert, delete, count, aggregate, and groupBy with typed examples. - Filtering and Relations: Documents scalar, logical, array, JSON, and relation filter operators (some, every, none, is) plus nested writes and connectOrCreate patterns. - 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 paginates users, filters by role, and includes related posts, consult this Skill to compose the correct findMany call with where, orderBy, take, cursor, and include options. ## Quick Start Ask the AI to write a Prisma query that finds all published posts by a given author with pagination and includes the comment count for each post.

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. For example, prisma.user.findMany({ where: { role: 'ADMIN' }, orderBy: { createdAt: 'desc' }, take: 10 }) returns 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 support options like maxWait, timeout, and isolationLevel.

Does Prisma Client support raw SQL queries safely?

Yes, $queryRaw and $executeRaw use tagged templates that automatically 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 include related records in a Prisma query?

Use the include option to load relations, or select to pick specific fields from related records. Both support nesting, filtering with where, ordering, and limiting, such as include: { posts: { where: { published: true }, take: 5 } }.

Why should I use a singleton pattern for PrismaClient in Next.js?

Next.js hot reloading in development creates a new PrismaClient on every reload, exhausting database connections. Storing the client on globalThis ensures a single instance persists across reloads while production uses a fresh instance.