GitLab Well Architected
Cookbook navigation
Prompts / Generate CRUD Operations

Generate CRUD Operations

DevelopmentAutomationReadCreateBeginner

Generate standard CRUD operations with validation, error handling, and basic tests.

For GitLab Duo

prompt

Generate CRUD operations for [ENTITY NAME]:

Fields:
[LIST FIELDS AND TYPES]

Include:
1. Database model
2. API endpoints
3. Input validation
4. Error handling
5. Basic tests

Use the prompt

Describe the entity's fields and who may read or change them. Existing model and endpoint examples help the generated code follow your project's conventions.