Commands
crud
Generate CRUD operations for your zopio
project
CRUD Command
The crud
command generates basic CRUD (Create, Read, Update, Delete) operations for your zopio
project. This command creates the necessary files for handling data operations in your application.
Usage
Options
Option | Description |
---|---|
-m, --model <name> | Model name for CRUD operations |
-f, --fields <fields> | Fields in format “name:type,age:number” |
-o, --output <directory> | Output directory for generated files |
-h, --help | Display help for command |
Examples
Generate CRUD operations for a User model
Generate CRUD operations with a custom output directory
Generated Files
When you run the crud
command, the following files will be generated:
- Controller: Handles HTTP requests and responses
- Service: Contains business logic for CRUD operations
- Repository: Interacts with the database
- Routes: Defines API endpoints for CRUD operations
- Model: Defines the data structure
Related Commands
For more specialized CRUD generation, you can use these related commands:
crud-schema
- Generate JSON schema and TypeScript interface for a modelcrud-ui
- Generate UI components for CRUD operationscrud-permissions
- Generate permissions configurationcrud-unified
- Generate a complete CRUD setupcrud-validation
- Generate validation schemascrud-testing
- Generate tests for CRUD operations