File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,13 @@ impl ToSql for PValue {
93
93
let val = Uuid :: parse_str ( str) . context ( "unable to parse uuid" ) ?;
94
94
val. to_sql ( ty, out)
95
95
}
96
- _ => Err ( format ! ( "string not supported for column of type {}" , ty) . into ( ) ) ,
96
+ _ => {
97
+ if let Kind :: Enum ( _) = ty. kind ( ) {
98
+ str. to_sql ( ty, out)
99
+ } else {
100
+ Err ( format ! ( "string not supported for column of type {}" , ty) . into ( ) )
101
+ }
102
+ }
97
103
} ,
98
104
99
105
PValue :: Number ( num) => match * ty {
@@ -235,7 +241,8 @@ impl ToSql for PValue {
235
241
| Type :: TIMESTAMPTZ
236
242
| Type :: DATE
237
243
| Type :: TIME
238
- ) || matches ! ( ty. kind( ) , Kind :: Array ( ty) if <PValue as ToSql >:: accepts( ty) )
244
+ ) || matches ! ( ty. kind( ) , Kind :: Enum ( _) )
245
+ || matches ! ( ty. kind( ) , Kind :: Array ( ty) if <PValue as ToSql >:: accepts( ty) )
239
246
}
240
247
to_sql_checked ! ( ) ;
241
248
}
You can’t perform that action at this time.
0 commit comments