diff --git a/sea-orm-macros/src/derives/from_query_result.rs b/sea-orm-macros/src/derives/from_query_result.rs index 2507dc4967..68f63fbedd 100644 --- a/sea-orm-macros/src/derives/from_query_result.rs +++ b/sea-orm-macros/src/derives/from_query_result.rs @@ -16,6 +16,14 @@ struct FromQueryResultItem { pub ident: Ident, } +/// Initially, we try to obtain the value for each field and check if it is an ordinary DB error +/// (which we return immediatly), or a null error. +/// +/// ### Background +/// +/// Null errors do not necessarily mean that the deserialization as a whole fails, +/// since structs embedding the current one might have wrapped the current one in an `Option`. +/// In this case, we do not want to swallow other errors, which are very likely to struct TryFromQueryResultCheck<'a>(&'a FromQueryResultItem); impl<'a> ToTokens for TryFromQueryResultCheck<'a> {