Skip to content

Commit

Permalink
Adds support for MYSQL doubles (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
Crossedfall committed Aug 10, 2020
1 parent f0645f9 commit 8ebb99b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ fn do_query(handle: &str, query: &str, params: &str) -> Result<serde_json::Value
mysql::Value::Float(f) => serde_json::Value::Number(
Number::from_f64(f64::from(*f)).unwrap_or_else(|| Number::from(0)),
),
mysql::Value::Double(f) => serde_json::Value::Number(
Number::from_f64(f64::from(*f)).unwrap_or_else(|| Number::from(0)),
),
mysql::Value::Int(i) => serde_json::Value::Number(Number::from(*i)),
mysql::Value::UInt(u) => serde_json::Value::Number(Number::from(*u)),
mysql::Value::Date(year, month, day, hour, minute, second, _ms) => {
Expand Down

0 comments on commit 8ebb99b

Please sign in to comment.