Expand description
The declarative resource model.
A resource is one models/<name>.toml file. It declares fields and a
per-action permission policy; the framework turns it into a Postgres table
and a set of RESTful CRUD endpoints. Users, roles and api-keys are ordinary
resources that ship with built-in defaults (see crate::defaults).
Structs§
- Auth
Spec - Auth configuration carried in a
[auth]section on theuserresource. - Field
- One column in a resource.
- Field
Admin - Per-field dashboard presentation, from
[fields.<name>.admin]. - Hooks
- The
[hooks]section of a resource: a function name per lifecycle event. - Permissions
- Per-action permissions. Strings in TOML are parsed via
Access::parse. - Reference
- A resolved
belongs_toedge: the referencing field, its target resource, and the JSON key it expands under (owner_id→owner). - Resource
- A fully-parsed resource definition.
- Resource
Admin - The
[admin]section of a resource: how it is presented — and to whom — in the generated dashboard. - Resource
Meta
Enums§
- Access
- Access policy for a single action on a resource.
- Auth
Event - One point in an auth endpoint’s lifecycle at which a function may run.
- Content
Format - What kind of content a free-text field holds.
- Field
Type - Supported column types.
- Hook
Event - One point in a resource’s request lifecycle at which a function may run.
- OnDelete
- Referential action applied by a foreign key when the parent row is deleted.
- Scope
- Whether a resource is isolated per organisation (the default) or shared across the whole deployment.
- Widget
- The input a field is edited with in the dashboard.
Functions§
- is_
auth_ resource - Whether a resource is one of the built-in auth/tenancy resources, which the dashboard manages through dedicated screens instead of generic CRUD.
- pluralize
- A deliberately small English pluraliser — enough for the labels apiplant
generates, and overridable per resource with
[admin] plural. - relation_
name - The relation name a reference field expands under:
owner_id→owner, otherwise the field name unchanged. - titleize
"purchase_order"→"Purchase order". Sentence case, not title case: a dashboard full of Capitalised Nouns reads like a form, not an application.