File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ extension Bind {
23
23
func cast< T> ( _ buffer: UnsafeMutableRawPointer , _ type: T . Type ) -> UnsafeMutablePointer < T > {
24
24
return buffer. bindMemory ( to: type, capacity: 1 )
25
25
}
26
-
26
+
27
27
28
28
func unwrap< T> ( _ buffer: UnsafeMutableRawPointer , _ type: T . Type ) -> T {
29
29
return buffer. load ( as: type)
@@ -97,6 +97,9 @@ extension Bind {
97
97
case MYSQL_TYPE_DOUBLE:
98
98
let double = unwrap ( buffer, Double . self)
99
99
return . number( . double( double) )
100
+ case MYSQL_TYPE_FLOAT:
101
+ let float = unwrap ( buffer, Float . self)
102
+ return . number( . double( Double ( float) ) )
100
103
case MYSQL_TYPE_DATE:
101
104
let time = unwrap ( buffer, MYSQL_TIME . self)
102
105
return . string( " \( time. year. pad ( 4 ) ) - \( time. month. pad ( 2 ) ) - \( time. day. pad ( 2 ) ) " )
You can’t perform that action at this time.
0 commit comments