You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey @sunli829 ! Thanks for all the work you put into this crate. It's truly awesome.
Description of the feature
I think it would be useful to easily convert from MaybeUndefined<T> to Option<Option<T>>,
where Undefined => None, Null => Some(None) and Value(a) => Some(Some(a)).
I'm using the Option<Option<T>> pattern to tell in my SQL queries if I should set the value to null or to not update it at all (custom code in SQLx), and Diesel uses this pattern by default too.
Hey @sunli829 ! Thanks for all the work you put into this crate. It's truly awesome.
Description of the feature
I think it would be useful to easily convert from
MaybeUndefined<T>
toOption<Option<T>>
,where
Undefined => None
,Null => Some(None)
andValue(a) => Some(Some(a))
.I'm using the
Option<Option<T>>
pattern to tell in my SQL queries if I should set the value to null or to not update it at all (custom code in SQLx), and Diesel uses this pattern by default too.Code example
This is the main type of use case I'm imagining:
What do you think? (I can implement the feature if you accept it)
The text was updated successfully, but these errors were encountered: