Trait diesel::query_builder::AsChangeset [] [src]

pub trait AsChangeset {
    type Target: QuerySource;
    type Changeset;
    fn as_changeset(self) -> Self::Changeset;

Types which can be passed to update.set.


This trait can be automatically derived using diesel_codegen 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")].

Associated Types

The table which Self::Changeset will be updating

The update statement this type represents

Required Methods

Convert self into the actual update statement being executed