Skip to main content

Crate toasty_macros

Crate toasty_macros 

Source
Expand description

Procedural macros for the Toasty ORM.

This crate provides #[derive(Model)], #[derive(Embed)], and related attribute macros that generate query builders, schema registration, and database mapping code.

Macros§

create
Expands struct-literal syntax into create builder method chains. Returns one or more create builders — call .exec(&mut db).await? to insert the record(s).
query
Builds a query using the Toasty query language. The macro expands into the equivalent method-chain calls on the query builder API. It does not execute the query — chain .exec(&mut db).await? on the result to run it.

Derive Macros§

Embed
Derive macro that turns a struct or enum into an embedded type stored inline in a parent model’s table.
Model
Derive macro that turns a struct into a Toasty model backed by a database table.