fix(sql): decode float columns as f32, closes #602

pull/607/head
FabianLars 2 years ago
parent 5b814f56e6
commit 8be2b34f78
No known key found for this signature in database
GPG Key ID: 838F329885A9C43D

@ -17,7 +17,14 @@ pub(crate) fn to_json(v: MySqlValueRef) -> Result<JsonValue, Error> {
JsonValue::Null
}
}
"FLOAT" | "DOUBLE" => {
"FLOAT" => {
if let Ok(v) = ValueRef::to_owned(&v).try_decode::<f32>() {
JsonValue::from(v)
} else {
JsonValue::Null
}
}
"DOUBLE" => {
if let Ok(v) = ValueRef::to_owned(&v).try_decode::<f64>() {
JsonValue::from(v)
} else {

Loading…
Cancel
Save