lode/field
A typed column reference: a column name carrying a phantom row, so the
schema/changeset/upsert APIs can name a schema’s columns without bare
strings. The name still lives in one place — a codegen-emitted accessor or
field — and the phantom makes call sites owner-checked: a Field(Post)
won’t go where a Field(User) is expected.
There is no reflection, so a Field(row) is not proven at compile time to
be a column of row. But codegen emits these from the schema spec, so the
generated accessors do correspond to real columns — the string is written
(or generated) once, not at every call site.
Types
Values
pub fn field(name name: String) -> Field(row)
Build a field reference from a column name. The row is inferred from use
(e.g. the schema passed alongside it), so a bare field("x") is checked
against the surrounding schema even though the name itself is a string.
pub fn fields(names names: List(String)) -> List(Field(row))
Build a list of field references from column names — the list-arg form, for
cast’s permitted list and validate_required. The row is inferred from
the surrounding schema/changeset.