Skip to main content

Module picker

Module picker 

Source
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§

PickerError
A picker source failed to search or resolve.
PickerNode
One candidate or resolved node. id is 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.
PickerSourceReg
A registered source: its dotted vendor.name key, the source, and an optional permission gating its endpoints (a source over sensitive data sets one).
TableSource
A built-in PickerSource over a single table: candidates are rows whose label_col matches (case-insensitive substring), and a stored id resolves by id_col. hint_col, when set, supplies each node’s disambiguating hint. A hierarchy or a computed label implements PickerSource directly instead.

Traits§

PickerSource
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§

PickerRegistry
The picker-source registry, keyed by source name.