Expand description
The reference-picker seam: a generic field picks a value from a data source (another table, a hierarchy) without the framework knowing the source.
A PickerSource is a domain service the picker field and its QUERY
endpoints call: it owns no route and returns PickerNodes, never HTML.
Sources are contributed to a PickerRegistry and selected by a field’s
{"source": "vendor.name"} option. TableSource is a built-in source over
a single table, so a simple reference needs no code; a hierarchy or a computed
label implements the trait directly.
Search and resolve are exposed as two routes under {admin}/pickers/{source},
served with the QUERY method (reads carry no CSRF token; the session cookie
and, optionally, a per-source permission gate them).
Structs§
- Picker
Error - A picker source failed to search or resolve.
- Picker
Node - One candidate or resolved node.
idis a string: the generic form layer treats stored values as text, and a JSON number would corrupt an integer id past 2^53 in the browser, so a picker id is never serialised as a number. - Picker
Source Reg - A registered source: its dotted
vendor.namekey, the source, and an optional permission gating its endpoints (a source over sensitive data sets one). - Table
Source - A built-in
PickerSourceover a single table: candidates are rows whoselabel_colmatches (case-insensitive substring), and a stored id resolves byid_col.hint_col, when set, supplies each node’s disambiguating hint. A hierarchy or a computed label implementsPickerSourcedirectly instead.
Traits§
- Picker
Source - A source of picker candidates: a domain service the picker field and its
endpoints call. Implementors build SQL in a scoped block and drop the builder
before awaiting (sea-query identifiers are not
Send), as the store queries elsewhere do.
Type Aliases§
- Picker
Registry - The picker-source registry, keyed by source name.