Skip to main content

Comparison

Derive Macro Comparison 

Source
#[derive(Comparison)]
{
    // Attributes available to this derive:
    #[ingraph]
}
Available on crate feature derive only.
Expand description

Give a HAND-WRITTEN struct the COMPARISON face — one predicate type per database it names, each field the comparison its column’s filter crosses into.

See Filter for the family’s law, its vocabulary and its refusals. What this door adds is the DATABASE set: #[ingraph(sqlite, postgres)] mints one comparison per database, named as a record’s is, and a declaration naming none gets ONE comparison generic in its dialect.

§The conversion hook

#[ingraph(filter = "path::to::Filter")] names the filter seat this comparison is crossed into FROM, and the door emits the map row that says so — ToDatabaseComparison<Self, Db>, exactly what a record emits for its own emitted filter. Without it, a FIELD-level conversion word refuses by name: a conversion refines a crossing, a crossing starts from a seat, and a refinement of nothing is not a thing to write.