@@ -9,13 +9,10 @@ impl FromQueryResult for JsonValue {
9
9
macro_rules! try_get_type {
10
10
( $type: ty, $col: ident ) => {
11
11
if let Ok ( v) = res. try_get:: <Option <$type>>( pre, & $col) {
12
- map. insert(
13
- $col. to_owned( ) ,
14
- json!( v) ,
15
- ) ;
12
+ map. insert( $col. to_owned( ) , json!( v) ) ;
16
13
continue ;
17
14
}
18
- }
15
+ } ;
19
16
}
20
17
match & res. row {
21
18
#[ cfg( feature = "sqlx-mysql" ) ]
@@ -58,9 +55,9 @@ impl FromQueryResult for JsonValue {
58
55
match_mysql_type ! ( chrono:: DateTime <chrono:: Utc >) ;
59
56
#[ cfg( feature = "with-rust_decimal" ) ]
60
57
match_mysql_type ! ( rust_decimal:: Decimal ) ;
61
- try_get_type ! ( String , col) ;
62
58
#[ cfg( feature = "with-json" ) ]
63
59
try_get_type ! ( serde_json:: Value , col) ;
60
+ try_get_type ! ( String , col) ;
64
61
#[ cfg( feature = "with-uuid" ) ]
65
62
try_get_type ! ( uuid:: Uuid , col) ;
66
63
try_get_type ! ( Vec <u8 >, col) ;
@@ -106,9 +103,9 @@ impl FromQueryResult for JsonValue {
106
103
match_postgres_type ! ( chrono:: DateTime <chrono:: FixedOffset >) ;
107
104
#[ cfg( feature = "with-rust_decimal" ) ]
108
105
match_postgres_type ! ( rust_decimal:: Decimal ) ;
109
- try_get_type ! ( String , col) ;
110
106
#[ cfg( feature = "with-json" ) ]
111
107
try_get_type ! ( serde_json:: Value , col) ;
108
+ try_get_type ! ( String , col) ;
112
109
#[ cfg( feature = "with-uuid" ) ]
113
110
try_get_type ! ( uuid:: Uuid , col) ;
114
111
try_get_type ! ( Vec <u8 >, col) ;
@@ -150,6 +147,8 @@ impl FromQueryResult for JsonValue {
150
147
match_sqlite_type ! ( chrono:: NaiveTime ) ;
151
148
#[ cfg( feature = "with-chrono" ) ]
152
149
match_sqlite_type ! ( chrono:: NaiveDateTime ) ;
150
+ #[ cfg( feature = "with-json" ) ]
151
+ try_get_type ! ( serde_json:: Value , col) ;
153
152
try_get_type ! ( String , col) ;
154
153
#[ cfg( feature = "with-uuid" ) ]
155
154
try_get_type ! ( uuid:: Uuid , col) ;
0 commit comments