prisma-client-api

Build Prisma Client queries with CRUD, filtering, relations, and transactions.

1|Updated May 1, 2026
One-click install
npx skills add https://github.com/Joshkovu/ghost-ai --skill prisma-client-api-joshkovu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma-client-api
Source: https://github.com/Joshkovu/ghost-ai/tree/main/.agents/skills/prisma-client-api
Command: npx skills add https://github.com/Joshkovu/ghost-ai --skill prisma-client-api-joshkovu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill reduces mistakes and guesswork when building Prisma Client queries by consolidating CRUD methods, query options, filtering operators, relation patterns, transactions, and raw-query safety into one reference.

Core Features & Use Cases

  • Prisma CRUD model queries: Use findUnique, findMany, create, update, upsert, delete, plus aggregation (count, aggregate, groupBy) with expected return semantics.
  • Query shaping with options: Control results via select, include, omit, orderBy, take, skip, cursor, and distinct.
  • Filtering and relations: Apply scalar operators, logical operators, relation filters (some/every/none, is/isNot), and nested reads/writes.
  • Transactions and raw SQL guidance: Choose between sequential vs interactive $transaction, and use $queryRaw/$executeRaw with parameterization and injection prevention.
  • Client lifecycle and extensions: Configure PrismaClient with constructor options and use $connect, $disconnect, $on, and $extends.

Quick Start

Use the prisma-client-api skill when you need to implement a safe Prisma database operation such as retrieving records with where filters, select/include shaping, and an optional transaction or raw query.

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 safe Prisma raw SQL queries in TypeScript?

To write safe Prisma raw SQL queries, use $queryRaw or $executeRaw with tagged templates or parameterized arrays to prevent injection. This ensures variables are safely escaped before hitting the database.

What is the difference between sequential and interactive transactions in Prisma?

Sequential Prisma transactions pass an array of queries to $transaction for simple batching, while interactive transactions use a callback function with $transaction to allow conditional logic and queries between steps.

How do I filter nested relations in Prisma Client?

Filter nested relations in Prisma Client by using relation filters like some, every, none, or is and isNot within your where clause. This allows precise matching against related record properties.

Can I select specific fields and paginate results with Prisma findMany?

You can shape Prisma findMany results by using select or include to choose specific fields, and implement pagination by combining take, skip, and cursor query options for efficient data retrieval.

When should I use Prisma upsert instead of create or update?

Use Prisma upsert when you need to create a record if it does not exist or update it if it does, ensuring atomic conditional writes. It requires unique fields to identify the target record.

How do I extend Prisma Client with custom logic in TypeScript?

Extend Prisma Client by using the $extends method to add custom logic, computed fields, or lifecycle hooks. This modifies the client instance while preserving existing type safety for database operations.