File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,13 @@ def map(self, value) -> Optional[Decimal]:
74
74
return Decimal (value )
75
75
76
76
77
+ class StringValueMapper (ValueMapper [str ]):
78
+ def map (self , value : Any ) -> Optional [str ]:
79
+ if value is None :
80
+ return None
81
+ return str (value )
82
+
83
+
77
84
class BinaryValueMapper (ValueMapper [bytes ]):
78
85
def map (self , value ) -> Optional [bytes ]:
79
86
if value is None :
@@ -252,8 +259,12 @@ def _create_value_mapper(self, column) -> ValueMapper:
252
259
return DoubleValueMapper ()
253
260
if col_type == 'decimal' :
254
261
return DecimalValueMapper ()
262
+ if col_type in {'varchar' , 'char' }:
263
+ return StringValueMapper ()
255
264
if col_type == 'varbinary' :
256
265
return BinaryValueMapper ()
266
+ if col_type == 'json' :
267
+ return StringValueMapper ()
257
268
if col_type == 'date' :
258
269
return DateValueMapper ()
259
270
if col_type == 'time' :
You can’t perform that action at this time.
0 commit comments