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
//! REST Query Syntax parser for REST API filtering plans.
//!
//! RestQS parses RQS query strings into typed plans. The core parser does not
//! emit SQL. Database and ORM translation lives in adapters, so application
//! code can keep parsing, authorization, and persistence concerns separate.
//!
//! A service starts with a [`FieldCatalog`]. The catalog maps public query
//! fields to trusted database columns and value kinds. The parser checks every
//! requested field against that catalog and returns [`RqsQuery`].
//!
//! # Basic Parsing
//!
//! ```
//! use restqs::{FieldCatalog, parse};
//!
//! let catalog = FieldCatalog::new()
//! .allow_integer("age", "users.age")?
//! .allow_text("status", "users.status")?;
//!
//! let query = parse("age>=18&status=in(active,pending)", &catalog)?;
//!
//! assert_eq!(query.filters().len(), 2);
//! # Ok::<(), restqs::RqsError>(())
//! ```
//!
//! # Safe Defaults
//!
//! RestQS treats query strings as untrusted input. User field names never
//! become database identifiers. Adapters receive trusted catalog columns and
//! typed [`RqsValue`] values.
//!
//! The default [`ParserLimits`] cap raw query length at 8 KiB, parameter count
//! at 128, single value length at 2 KiB, list item count at 100, and `limit=`
//! at 100.
//!
//! # Adapter Boundary
//!
//! The `sqlx` feature exposes SQLx-oriented fragment generation through
//! [`adapters::sqlx`]. The adapter returns SQL fragments and bind values. The
//! host repository still owns the final SQL statement, connection, transaction,
//! and result mapping.
pub use ;
pub use ;
pub use ;
pub use ParserLimits;
pub use Pagination;
pub use ;
pub use Projection;
pub use RqsQuery;
pub use ;
pub use RqsValue;