prisma-client-api

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

Updated Aug 31, 2026
One-click install
npx skills add https://github.com/Akhand0ps/vecta --skill prisma-client-api-akhand0ps
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-client-api
Source: https://github.com/Akhand0ps/vecta/tree/main/packages/db/.agents/skills/prisma-client-api
Command: npx skills add https://github.com/Akhand0ps/vecta --skill prisma-client-api-akhand0ps

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, relation patterns, and transaction APIs. This Skill gives you an on-demand reference so you can write accurate database queries without leaving your workflow to search documentation. ## Core Features & Use Cases - Complete Query Reference: Covers all model query methods including findUnique, findMany, create, update, upsert, delete, count, aggregate, and groupBy with return type tables. - Filtering and Relations: Documents scalar operators, logical operators (AND, OR, NOT), relation filters (some, every, none, is), and nested write patterns 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 guidance. - Use Case: When building a multi-tenant REST API like Vecta's backend, use this Skill to correctly write a filtered findMany query with pagination, relation includes, and an interactive transaction for balance updates. ## Quick Start Ask the AI to write a Prisma query that finds all admin users with their published posts, 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 admins with matching emails.

How to use Prisma transactions for multiple 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 options like maxWait, timeout, and isolationLevel such as Serializable.

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 values automatically, preventing SQL injection. Avoid $queryRawUnsafe with string concatenation, and use Prisma.sql and Prisma.join for dynamic query fragments.

How do I connect or create related records in Prisma?

Use nested writes with connect to link existing records, create to make new ones, or connectOrCreate to do either based on a unique where clause. For example, author: { connectOrCreate: { where: { email }, create: {...} } }.

Why does Prisma findUnique return null instead of throwing?

findUnique returns null when no record matches by design. Use findUniqueOrThrow or findFirstOrThrow to raise a PrismaClientKnownRequestError instead, which is useful inside transactions to trigger automatic rollback.