Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sqlx-macros-core/src/query/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ pub fn quote_query_as<DB: DatabaseExt>(
// binding to a `let` avoids confusing errors about
// "try expression alternatives have incompatible types"
// it doesn't seem to hurt inference in the other branches
let #var_name = row.try_get_unchecked::<#type_, _>(#i)?.into();
let #var_name = row.try_get_unchecked::<#type_, _>(#i)?
.try_into()
.map_err(|err| ::sqlx::Error::Decode(err.into()))?;
},
// type was overridden to be a wildcard so we fallback to the runtime check
(true, ColumnType::Wildcard) => quote! ( let #var_name = row.try_get(#i)?; ),
Expand Down