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
.
Deriving
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
Required Methods
fn as_changeset(self) -> Self::Changeset
Implementors
impl<T: AsChangeset> AsChangeset for Option<T>
impl<Target, A> AsChangeset for (A,) where A: AsChangeset<Target=Target>,
Target: QuerySourceimpl<Target, A, B> AsChangeset for (A, B) where A: AsChangeset<Target=Target>,
B: AsChangeset<Target=Target>,
Target: QuerySourceimpl<Target, A, B, C> AsChangeset for (A, B, C) where A: AsChangeset<Target=Target>,
B: AsChangeset<Target=Target>,
C: AsChangeset<Target=Target>,
Target: QuerySourceimpl<Target, A, B, C, D> AsChangeset for (A, B, C, D) where A: AsChangeset<Target=Target>,
B: AsChangeset<Target=Target>,
C: AsChangeset<Target=Target>,
D: AsChangeset<Target=Target>,
Target: QuerySourceimpl<Target, A, B, C, D, E> AsChangeset for (A, B, C, D, E) where A: AsChangeset<Target=Target>,
B: AsChangeset<Target=Target>,
C: AsChangeset<Target=Target>,
D: AsChangeset<Target=Target>,
E: AsChangeset<Target=Target>,
Target: QuerySourceimpl<Target, A, B, C, D, E, F> AsChangeset for (A, B, C, D, E, F) where A: AsChangeset<Target=Target>,
B: AsChangeset<Target=Target>,
C: AsChangeset<Target=Target>,
D: AsChangeset<Target=Target>,
E: AsChangeset<Target=Target>,
F: AsChangeset<Target=Target>,
Target: QuerySourceimpl<Target, A, B, C, D, E, F, G> AsChangeset for (A, B, C, D, E, F, G) where A: AsChangeset<Target=Target>,
B: AsChangeset<Target=Target>,
C: AsChangeset<Target=Target>,
D: AsChangeset<Target=Target>,
E: AsChangeset<Target=Target>,
F: AsChangeset<Target=Target>,
G: AsChangeset<Target=Target>,
Target: QuerySourceimpl<Target, A, B, C, D, E, F, G, H> AsChangeset for (A, B, C, D, E, F, G, H) where A: AsChangeset<Target=Target>,
B: AsChangeset<Target=Target>,
C: AsChangeset<Target=Target>,
D: AsChangeset<Target=Target>,
E: AsChangeset<Target=Target>,
F: AsChangeset<Target=Target>,
G: AsChangeset<Target=Target>,
H: AsChangeset<Target=Target>,
Target: QuerySourceimpl<Target, A, B, C, D, E, F, G, H, I> AsChangeset for (A, B, C, D, E, F, G, H, I) where A: AsChangeset<Target=Target>,
B: AsChangeset<Target=Target>,
C: AsChangeset<Target=Target>,
D: AsChangeset<Target=Target>,
E: AsChangeset<Target=Target>,
F: AsChangeset<Target=Target>,
G: AsChangeset<Target=Target>,
H: AsChangeset<Target=Target>,
I: AsChangeset<Target=Target>,
Target: QuerySourceimpl<Target, A, B, C, D, E, F, G, H, I, J> AsChangeset for (A, B, C, D, E, F, G, H, I, J) where A: AsChangeset<Target=Target>,
B: AsChangeset<Target=Target>,
C: AsChangeset<Target=Target>,
D: AsChangeset<Target=Target>,
E: AsChangeset<Target=Target>,
F: AsChangeset<Target=Target>,
G: AsChangeset<Target=Target>,
H: AsChangeset<Target=Target>,
I: AsChangeset<Target=Target>,
J: AsChangeset<Target=Target>,
Target: QuerySourceimpl<Target, A, B, C, D, E, F, G, H, I, J, K> AsChangeset for (A, B, C, D, E, F, G, H, I, J, K) where A: AsChangeset<Target=Target>,
B: AsChangeset<Target=Target>,
C: AsChangeset<Target=Target>,
D: AsChangeset<Target=Target>,
E: AsChangeset<Target=Target>,
F: AsChangeset<Target=Target>,
G: AsChangeset<Target=Target>,
H: AsChangeset<Target=Target>,
I: AsChangeset<Target=Target>,
J: AsChangeset<Target=Target>,
K: AsChangeset<Target=Target>,
Target: QuerySourceimpl<Target, A, B, C, D, E, F, G, H, I, J, K, L> AsChangeset for (A, B, C, D, E, F, G, H, I, J, K, L) where A: AsChangeset<Target=Target>,
B: AsChangeset<Target=Target>,
C: AsChangeset<Target=Target>,
D: AsChangeset<Target=Target>,
E: AsChangeset<Target=Target>,
F: AsChangeset<Target=Target>,
G: AsChangeset<Target=Target>,
H: AsChangeset<Target=Target>,
I: AsChangeset<Target=Target>,
J: AsChangeset<Target=Target>,
K: AsChangeset<Target=Target>,
L: AsChangeset<Target=Target>,
Target: QuerySourceimpl<Target, A, B, C, D, E, F, G, H, I, J, K, L, M> AsChangeset for (A, B, C, D, E, F, G, H, I, J, K, L, M) where A: AsChangeset<Target=Target>,
B: AsChangeset<Target=Target>,
C: AsChangeset<Target=Target>,
D: AsChangeset<Target=Target>,
E: AsChangeset<Target=Target>,
F: AsChangeset<Target=Target>,
G: AsChangeset<Target=Target>,
H: AsChangeset<Target=Target>,
I: AsChangeset<Target=Target>,
J: AsChangeset<Target=Target>,
K: AsChangeset<Target=Target>,
L: AsChangeset<Target=Target>,
M: AsChangeset<Target=Target>,
Target: QuerySourceimpl<Target, A, B, C, D, E, F, G, H, I, J, K, L, M, N> AsChangeset for (A, B, C, D, E, F, G, H, I, J, K, L, M, N) where A: AsChangeset<Target=Target>,
B: AsChangeset<Target=Target>,
C: AsChangeset<Target=Target>,
D: AsChangeset<Target=Target>,
E: AsChangeset<Target=Target>,
F: AsChangeset<Target=Target>,
G: AsChangeset<Target=Target>,
H: AsChangeset<Target=Target>,
I: AsChangeset<Target=Target>,
J: AsChangeset<Target=Target>,
K: AsChangeset<Target=Target>,
L: AsChangeset<Target=Target>,
M: AsChangeset<Target=Target>,
N: AsChangeset<Target=Target>,
Target: QuerySourceimpl<Target, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> AsChangeset for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) where A: AsChangeset<Target=Target>,
B: AsChangeset<Target=Target>,
C: AsChangeset<Target=Target>,
D: AsChangeset<Target=Target>,
E: AsChangeset<Target=Target>,
F: AsChangeset<Target=Target>,
G: AsChangeset<Target=Target>,
H: AsChangeset<Target=Target>,
I: AsChangeset<Target=Target>,
J: AsChangeset<Target=Target>,
K: AsChangeset<Target=Target>,
L: AsChangeset<Target=Target>,
M: AsChangeset<Target=Target>,
N: AsChangeset<Target=Target>,
O: AsChangeset<Target=Target>,
Target: QuerySourceimpl<Target, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P> AsChangeset for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) where A: AsChangeset<Target=Target>,
B: AsChangeset<Target=Target>,
C: AsChangeset<Target=Target>,
D: AsChangeset<Target=Target>,
E: AsChangeset<Target=Target>,
F: AsChangeset<Target=Target>,
G: AsChangeset<Target=Target>,
H: AsChangeset<Target=Target>,
I: AsChangeset<Target=Target>,
J: AsChangeset<Target=Target>,
K: AsChangeset<Target=Target>,
L: AsChangeset<Target=Target>,
M: AsChangeset<Target=Target>,
N: AsChangeset<Target=Target>,
O: AsChangeset<Target=Target>,
P: AsChangeset<Target=Target>,
Target: QuerySource