Expand description
Query filter system inspired by Laravel Filter Query String
Provides a flexible, type-safe filtering system for database queries. Supports complex query expressions through URL-friendly parameters.
§Example Query String
?username[contain]=john&age[gt]=18&status[eq]=active&orderby=name&limit=10§Supported Operators
| Operator | Description | SQL Equivalent |
|---|---|---|
eq | Equal | field = value |
notEq | Not equal | field != value |
gt | Greater than | field > value |
gte / gtEq | Greater or equal | field >= value |
lt | Less than | field < value |
lte / ltEq | Less or equal | field <= value |
like | Case-sensitive LIKE | field LIKE value |
ilike | Case-insensitive LIKE | field ILIKE value |
notlike | NOT LIKE | field NOT LIKE value |
contain | Contains | field LIKE %value% |
notcontain | Does not contain | field NOT LIKE %value% |
startwith | Starts with | field LIKE value% |
endwith | Ends with | field LIKE %value |
in | In array | field IN (...) |
notin | Not in array | field NOT IN (...) |
between | Between two values | field BETWEEN a AND b |
notbetween | Not between | field NOT BETWEEN a AND b |
isnull | Is null | field IS NULL |
isnotnull | Is not null | field IS NOT NULL |
or | OR condition | OR field = value |
Re-exports§
pub use cursor::CursorPayload;pub use cursor::CursorError;pub use cursor::encode_cursor;pub use cursor::decode_cursor;
Modules§
- cursor
- Keyset (cursor) paging for the generic list endpoint.
Structs§
- Filter
Condition - A single filter condition
- Query
Filter - Complete query filter specification
- Sort
Spec - Sort specification
Enums§
- Filter
Logical - Logical operator for combining conditions
- Filter
Operator - Filter operator types
- Filter
Value - Filter condition value
- Sort
Direction - Sort direction
Traits§
- Filterable
Entity - Trait for entities to declare which fields are allowed in filter queries.
Functions§
- is_
valid_ field - Validate a field name against an allow-list
- parse_
filters - Parse filter from query parameters HashMap
- sanitize_
field_ name - Sanitize a field name for SQL identifier use