Skip to main content

Module form

Module form 

Source
Expand description

Descriptor-driven create and edit forms.

A FormConfig describes a table and its editable fields. Generic handlers render an empty form (new), a populated form (edit), and persist via dynamic insert/update SQL built from the descriptor. Values are always parameterized.

This first slice supports scalar text fields (text and textarea widgets), which is enough for the roles screen it is dogfooded on. Typed and transforming fields (switches, selects, password hashing) are later widgets.

The primary key is a bigint auto-increment column the database assigns, so create inserts only the descriptor’s fields and never sets the id. An entity with other required columns that lack defaults (for example audit timestamps) is beyond this slice; those are filled by a later timestamp-aware widget.

Structs§

FormConfig
A form descriptor: which table, its editable fields, the id column, and the base path the form lives under ({base_path}/new, {base_path}/{id}/edit).
FormField
One editable field: the column, its label, its widget, and whether required.

Enums§

WidgetKind