Expand description
#[derive(Row)] and #[derive(Columns)] for magic_sync: one struct is
one table, column for column, and says how it travels. Use them through
magic_sync, which re-exports both; every attribute is documented there,
on magic_sync::Row.
Everything the derive is told is checked where it is written: a key that is not a field, a column named twice, an attribute a table of its kind cannot have, a key or version of a type the engine cannot read — each is a compile error pointing at the token that says it.
Derive Macros§
- Columns
- Implements
magic_sync::Columnsfor a part of a row, which the row brings in with#[sqlx(flatten)]. Use it asmagic_sync::Columns: its fields take the same#[row(…)]flags as a row’s, and the struct onlycrate. - Row
- Implements
magic_sync::Rowfor a struct that is one table, column for column. Use it asmagic_sync::Row: the attributes it reads (#[row(…)]on the struct and its fields, and the#[sqlx(…)]keys that name a column) are documented there.