1
1
use crate :: any:: value:: AnyValueKind ;
2
- use crate :: any:: Any ;
2
+ use crate :: any:: { Any , AnyTypeInfoKind } ;
3
3
use crate :: arguments:: Arguments ;
4
4
use crate :: encode:: { Encode , IsNull } ;
5
5
use crate :: error:: BoxDynError ;
@@ -46,6 +46,14 @@ impl<'q> AnyArguments<'q> {
46
46
where
47
47
' q : ' a ,
48
48
Option < i32 > : Type < A :: Database > + Encode < ' a , A :: Database > ,
49
+ Option < bool > : Type < A :: Database > + Encode < ' a , A :: Database > ,
50
+ Option < i16 > : Type < A :: Database > + Encode < ' a , A :: Database > ,
51
+ Option < i32 > : Type < A :: Database > + Encode < ' a , A :: Database > ,
52
+ Option < i64 > : Type < A :: Database > + Encode < ' a , A :: Database > ,
53
+ Option < f32 > : Type < A :: Database > + Encode < ' a , A :: Database > ,
54
+ Option < f64 > : Type < A :: Database > + Encode < ' a , A :: Database > ,
55
+ Option < String > : Type < A :: Database > + Encode < ' a , A :: Database > ,
56
+ Option < Vec < u8 > > : Type < A :: Database > + Encode < ' a , A :: Database > ,
49
57
bool : Type < A :: Database > + Encode < ' a , A :: Database > ,
50
58
i16 : Type < A :: Database > + Encode < ' a , A :: Database > ,
51
59
i32 : Type < A :: Database > + Encode < ' a , A :: Database > ,
@@ -59,7 +67,15 @@ impl<'q> AnyArguments<'q> {
59
67
60
68
for arg in & self . values . 0 {
61
69
match arg {
62
- AnyValueKind :: Null => out. add ( Option :: < i32 > :: None ) ,
70
+ AnyValueKind :: Null ( AnyTypeInfoKind :: Null ) => out. add ( Option :: < i32 > :: None ) ,
71
+ AnyValueKind :: Null ( AnyTypeInfoKind :: Bool ) => out. add ( Option :: < bool > :: None ) ,
72
+ AnyValueKind :: Null ( AnyTypeInfoKind :: SmallInt ) => out. add ( Option :: < i16 > :: None ) ,
73
+ AnyValueKind :: Null ( AnyTypeInfoKind :: Integer ) => out. add ( Option :: < i32 > :: None ) ,
74
+ AnyValueKind :: Null ( AnyTypeInfoKind :: BigInt ) => out. add ( Option :: < i64 > :: None ) ,
75
+ AnyValueKind :: Null ( AnyTypeInfoKind :: Real ) => out. add ( Option :: < f64 > :: None ) ,
76
+ AnyValueKind :: Null ( AnyTypeInfoKind :: Double ) => out. add ( Option :: < f32 > :: None ) ,
77
+ AnyValueKind :: Null ( AnyTypeInfoKind :: Text ) => out. add ( Option :: < String > :: None ) ,
78
+ AnyValueKind :: Null ( AnyTypeInfoKind :: Blob ) => out. add ( Option :: < Vec < u8 > > :: None ) ,
63
79
AnyValueKind :: Bool ( b) => out. add ( b) ,
64
80
AnyValueKind :: SmallInt ( i) => out. add ( i) ,
65
81
AnyValueKind :: Integer ( i) => out. add ( i) ,
@@ -70,7 +86,6 @@ impl<'q> AnyArguments<'q> {
70
86
AnyValueKind :: Blob ( b) => out. add ( & * * b) ,
71
87
} ?
72
88
}
73
-
74
89
Ok ( out)
75
90
}
76
91
}
0 commit comments