Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".
Detected risks:
The prisma-client-api skill provides a comprehensive reference for interacting with databases using Prisma Client. It streamlines the process of constructing queries, performing CRUD operations, applying filters, managing relations, and handling transactions within Prisma projects. By offering detailed guidance on client instantiation, model queries, query options, and raw SQL execution, this skill helps developers reduce errors and improve efficiency when working with relational databases. It is particularly useful for ensuring that queries are structured correctly and that advanced operations like nested writes and transactions are handled safely and effectively.
This skill covers a wide range of capabilities including model query methods such as findUnique, findMany, create, update, delete, upsert, and aggregation functions like count, aggregate, and groupBy. It also provides extensive support for query options, allowing developers to filter, select, include, omit, sort, paginate, and enforce distinct values. Prisma Client methods for lifecycle management, event subscriptions, raw SQL execution, and client extensions are also included. The skill ensures safe execution of raw SQL queries and provides guidance on using transactions, both array-based and interactive, to maintain data integrity.
Target users include backend developers, database administrators, and full-stack engineers working with JavaScript or TypeScript who need to efficiently interact with databases via Prisma. Typical use cases involve building web applications, APIs, and microservices where precise data retrieval, manipulation, and aggregation are critical. It is also suitable for teams that require a standard reference for consistent query patterns and best practices when implementing complex relational logic or performing batch operations in production environments.
You can instantiate Prisma Client by importing PrismaClient and your adapter, then passing the adapter configuration to the client constructor, as shown in the provided TypeScript example.
Prisma Client supports full CRUD operations including findUnique, findMany, create, createMany, update, updateMany, upsert, delete, and deleteMany. It also supports aggregation and grouping methods.
Yes, Prisma Client supports both array-based and interactive transactions using the $transaction method, allowing multiple queries to be executed safely within a single transaction.
Prisma Client provides $queryRaw and $executeRaw methods for executing raw SQL queries. These should be used carefully to avoid SQL injection, and the documentation provides guidance for safe usage.
You need a Prisma project with a generated client, a supported database, and an appropriate adapter. TypeScript or JavaScript environments are required for client instantiation and query execution.
Quick Setup:
.claude/skills/Repository
prisma/skills