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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//! Filtering, sorting, pagination, and fulltext search.
//!
//! This module translates query parameters into Sea-ORM conditions. When you mark fields
//! with `#[crudcrate(filterable)]`, `#[crudcrate(sortable)]`, or `#[crudcrate(fulltext)]`,
//! the generated handlers use these utilities to parse incoming requests.
//!
//! # Query parameter reference
//!
//! ## Filtering
//!
//! Filters are passed as a JSON object in the `filter` query parameter. Operator suffixes
//! on field names control the comparison:
//!
//! | Suffix | SQL equivalent | Example |
//! |--------|---------------|---------|
//! | *(none)* | `= value` | `{"completed": false}` |
//! | `_neq` | `!= value` | `{"status_neq": "archived"}` |
//! | `_gt` | `> value` | `{"priority_gt": 3}` |
//! | `_gte` | `>= value` | `{"priority_gte": 3}` |
//! | `_lt` | `< value` | `{"priority_lt": 10}` |
//! | `_lte` | `<= value` | `{"priority_lte": 10}` |
//! | `_like` | `LIKE %value%` | `{"name_like": "john"}` |
//!
//! Multiple values for the same field (comma-separated) produce an `IN` clause.
//!
//! ## Fulltext search
//!
//! The `q` parameter searches across all fields marked `fulltext`:
//!
//! ```text
//! GET /todos?q=urgent review
//! ```
//!
//! On `PostgreSQL` this uses `to_tsvector`/`to_tsquery` with GIN indexes.
//! On `MySQL` it uses `MATCH ... AGAINST`. On `SQLite` it falls back to `LIKE`.
//!
//! ## Sorting
//!
//! ```text
//! GET /todos?sort=["created_at","DESC"]
//! GET /todos?sort=created_at&order=DESC
//! ```
//!
//! ## Pagination
//!
//! ```text
//! GET /todos?range=[0,24] # React Admin style
//! GET /todos?page=1&per_page=25 # page-based
//! ```
//!
//! Responses include `Content-Range` and `X-Total-Count` headers.
//!
//! # Key types
//!
//! - [`FilterOptions`] — parsed query parameters for a list request
//! - [`BatchOptions`] — options for batch endpoints (e.g. `?partial=true`)
//! - [`apply_filters`] — builds a Sea-ORM `Condition` from filter params
//! - [`parse_sorting`] — resolves sort parameters to column + direction
//! - [`parse_pagination`] — extracts offset/limit from query params
// Re-export commonly used items
pub use ;
pub use ;
pub use calculate_content_range;
pub use ;
pub use build_fulltext_condition;
pub use ;