I meet compiling error when I use DeriveIntoActiveModel to convert the struct to ActiveModel. The struct has only part of fields and these fields are wrapped with Option. Here is an example script:
the trait bound `ActiveValue<String>: From<ActiveValue<std::option::Option<String>>>` is not satisfied
the following implementations were found:
<ActiveValue<std::option::Option<V>> as From<ActiveValue<V>>>
required because of the requirements on the impl of `Into<ActiveValue<String>>` for `ActiveValue<std::option::Option<String>>`
the trait bound `ActiveValue<f32>: From<ActiveValue<std::option::Option<f32>>>` is not satisfied
the following implementations were found:
<ActiveValue<std::option::Option<V>> as From<ActiveValue<V>>>
required because of the requirements on the impl of `Into<ActiveValue<f32>>` for `ActiveValue<std::option::Option<f32>>`
The error says the Option<T> is converted to ActiveValue<Option<T>>. But I want Option<T> to be converted to ActiveValue<T> in my use case.
I meet compiling error when I use
DeriveIntoActiveModel
to convert the struct toActiveModel
. The struct has only part of fields and these fields are wrapped withOption
. Here is an example script:And here is the detailed compiling error:
The error says the
Option<T>
is converted toActiveValue<Option<T>>
. But I wantOption<T>
to be converted toActiveValue<T>
in my use case.I think the associated code is here: https://github.com/SeaQL/sea-orm/blob/f2a774573a962426d5c4ac9a5abb74d5b63313b9/src/entity/active_model.rs#L301-L308
I fix the bug and I will issue a PR.