pub trait AsChangeset {
type Target: QuerySource;
type Changeset;
// Required method
fn as_changeset(self) -> Self::Changeset;
}
Expand description
Types which can be passed to
update.set
.
§Deriving
This trait can be automatically derived using by adding #[derive(AsChangeset)]
to your struct. Structs which derive this trait must be annotated with
#[table_name = "something"]
. If the field name of your struct differs
from the name of the column, you can annotate the field with
#[column_name = "some_column_name"]
.
By default, any Option
fields on the struct are skipped if their value is
None
. If you would like to assign NULL
to the field instead, you can
annotate your struct with #[changeset_options(treat_none_as_null = "true")]
.
Required Associated Types§
Sourcetype Target: QuerySource
type Target: QuerySource
The table which Self::Changeset
will be updating
Required Methods§
Sourcefn as_changeset(self) -> Self::Changeset
fn as_changeset(self) -> Self::Changeset
Convert self
into the actual update statement being executed