Expand description
Procedural macros for rxferrix: #[table], #[object], #[query], #[mutation], #[action], the internal_*
variants, #[workflow], and #[migration].
The expansions are specified normatively in docs/CONTRACT.md §3. Every path the expansions use is fully
qualified (::core::.., ::std::.., ::rxferrix::..), so use items in user code cannot change their meaning.
Notes for users:
#[table]adds#[derive(Serialize, Deserialize, TS, Clone, Debug)]itself. Deriving any of these again is a compile error. Put#[table]before any#[derive]and#[index]attributes.- After
#[query](etc.), the fn is kept as is (still directly callable). A braced struct with the same name (pub struct list {}, type namespace only) is the function reference:ctx.run_query::<list>(args).
Attribute Macros§
- action
- Declares a public action function. See
docs/CONTRACT.md§3.2. Takesdev_onlylike#[query]. - internal_
action - Declares an action that cannot be called by clients. See
docs/CONTRACT.md§3.2. - internal_
mutation - Declares a mutation that cannot be called by clients. See
docs/CONTRACT.md§3.2. - internal_
query - Declares a query that cannot be called by clients. See
docs/CONTRACT.md§3.2. - migration
- Declares a data migration over one table, run in batches. See
docs/CONTRACT.md§1.9 and §3.3. - mutation
- Declares a public mutation function. See
docs/CONTRACT.md§3.2. Takesdev_onlylike#[query]. - object
- A type used in function signatures that is not a table: a function’s output (a “view” struct), an argument, or
a type nested in either. See
docs/CONTRACT.md§3.4. - query
- Declares a public query function. See
docs/CONTRACT.md§3.2.#[query(dev_only)]: refused unless the server runs with--dev, and generated intodevApiinstead ofapi. - table
- Declares a table document type. See
docs/CONTRACT.md§3.1. - workflow
- Declares a durable workflow: an
async fntakingstep: &WorkflowCtxwhose steps (step.run_query,run_mutation,run_action,sleep,wait_for_event) are journaled, so it survives restarts and can run for days. Started withctx.workflows.start::<name>(args). Seerxferrix::workflow.