1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! # Auto-Generated CRUD Operations
//!
//! This module provides the core functionality for automatically generating complete CRUD (Create, Read, Update, Delete) operations from Sea-ORM entities.
//!
//! ## Main Components
//!
//! - **[`CRUDResource`](@/traits/trait.CRUDResource.html)**: Central trait that defines CRUD operations, filtering, and sorting capabilities
//! - **[`MergeIntoActiveModel`](@/traits/trait.MergeIntoActiveModel.html)**: Helper trait for merging API structs into `ActiveModel`
//!
//! ## Generated Operations
//!
//! When you use `#[derive(EntityToModels)]`, the following operations are automatically generated:
//!
//! ### HTTP Endpoints
//! - `GET /resource` - List all items with filtering and pagination
//! - `GET /resource/{id}` - Get specific item by ID
//! - `POST /resource` - Create new item
//! - `POST /resource/batch` - Batch create items
//! - `PUT /resource/{id}` - Update existing item
//! - `PATCH /resource/batch` - Batch update items
//! - `DELETE /resource/{id}` - Delete specific item
//! - `DELETE /resource/batch` - Bulk delete by IDs
//!
//! ### Generated Structs
//! - **API Struct** (e.g., `Todo`): For HTTP responses
//! - **Create Struct** (e.g., `TodoCreate`): For POST requests, excludes auto-generated fields
//! - **Update Struct** (e.g., `TodoUpdate`): For PUT requests, excludes primary keys
//! - **List Struct** (e.g., `TodoList`): Optimized for list responses
//!
//! ## Example Usage
//!
//! ```rust,ignore
//! use crudcrate::core::CRUDResource;
//! use sea_orm::DatabaseConnection;
//!
//! // The CRUDResource trait is automatically implemented
//! // when you use #[derive(EntityToModels)]
//!
//! // Manual usage (usually not needed - use generated router instead):
//! let todo = Todo::get_one(&db, id).await?;
//! let todos = Todo::get_all(&db, Some(filter_options)).await?;
//! let created = Todo::create(&db, todo_create).await?;
//! let updated = Todo::update(&db, id, todo_update).await?;
//! let deleted = Todo::delete(&db, id).await?;
//! ```
// Re-export commonly used items
pub use ;