prisma-crud Skill

Generate database CRUD operations with Prisma including queries, transactions, and Server Actions.

Overview#

The prisma-crud skill generates production-ready database operations using Prisma ORM, including proper client initialization, common query patterns, and transactional operations.

Usage#

Use the prisma-crud skill to create CRUD operations for a Post model.

Parameters#

ParameterTypeRequiredDescription
modelstringYesPrisma model name
operationsarrayNoOperations: create, read, update, delete, list
relationsarrayNoRelated models to include
softDeletebooleanNoEnable soft delete pattern
serverActionsbooleanNoGenerate as Server Actions

Generated Output#

Prisma Client Singleton#

Loading code block...

Create Operation#

Loading code block...

Read Operations#

Loading code block...

Update Operations#

Loading code block...

Delete Operations#

Loading code block...

Transactions#

Loading code block...

Credit Transfer Transaction#

Loading code block...

Server Action Pattern#

Loading code block...

Optimistic Locking#

Loading code block...

Schema Example#

Loading code block...

Features Included#

  • Singleton client pattern
  • CRUD operations with relations
  • Pagination support
  • Transaction handling
  • Soft delete pattern
  • Server Actions integration
  • Optimistic locking

Migration Commands#

Loading code block...

Customization Options#

Use the prisma-crud skill with: - model: "Post" - operations: ["create", "read", "update", "list"] - relations: ["author", "comments"] - softDelete: true - serverActions: true

Best Practices#

Singleton Pattern#

Always use the singleton pattern to prevent connection exhaustion during development hot reloads.

Select Only What You Need#

Loading code block...
Loading code block...

Index Frequently Queried Fields#

Loading code block...