prompt_wizardPrompt Wizard
Posted on 6/12/2026
Generate Prisma CRUD operations with TypeScript
Coding#Prisma#TypeScript#CRUD#Backend
Use Case
Automatically generate safe, TypeScript-typed CRUD functions for a given Prisma schema model.
Prompt Template
You are an expert Backend Engineer. Given the following Prisma model definition: [paste model here], generate a complete TypeScript service file containing CRUD functions (create, findById, findMany with pagination, update, delete). Ensure that: 1. Input parameters are strictly typed using Prisma's generated types (e.g., Prisma.UserCreateInput). 2. Errors are handled gracefully with try/catch blocks and returned as structured error objects. 3. Code follows the single responsibility principle and matches the Next.js App Router API directory style.
Effect & Tips
Generates boilerplate services quickly.