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
/// Result of a `.select(...)`-projected read. Holds the model with
/// only the selected columns populated — non-selected fields carry
/// their type's `Default::default()` value (`""` for `String`, `0`
/// for integers, `None` for `Option<T>`, etc.).
///
/// **Caller responsibility:** check [`Self::is_selected`] before
/// reading a field if you need to distinguish "real zero-valued DB
/// row" from "the runtime didn't fetch this column". For typical use
/// — fetch one or two specific columns for a route that needs only
/// those — just read the fields you asked for and don't read the
/// others.
///
/// **Compile-time constraint:** every model field type must impl
/// `Default`. The codegen emits a `#[derive(Default)]` on the model
/// struct; any field type that doesn't satisfy `Default` (typically a
/// `Json<MyCustomType>` where `MyCustomType` doesn't derive Default)
/// becomes a compile error at the `include_server_schema!` /
/// `include_embedded_schema!` boundary. Wrap the offending field in
/// `Option` or derive `Default` on the custom struct.