@@ -56,6 +56,14 @@ def process(value):
56
56
57
57
return process
58
58
59
+ def literal_processor (self , dialect ):
60
+ def process (value ):
61
+ if isinstance (value , datetime .date ):
62
+ return "'%s'" % value .strftime ("%Y-%m-%d" )
63
+ return value
64
+
65
+ return process
66
+
59
67
60
68
class IRISTimeStamp (sqltypes .DateTime ):
61
69
__visit_name__ = "TIMESTAMP"
@@ -84,6 +92,14 @@ def process(value):
84
92
85
93
return process
86
94
95
+ def literal_processor (self , dialect ):
96
+ def process (value ):
97
+ if isinstance (value , datetime .datetime ):
98
+ return "'%s'" % value .strftime ("%Y-%m-%d %H:%M:%S.%f" )
99
+ return value
100
+
101
+ return process
102
+
87
103
88
104
class IRISDateTime (sqltypes .DateTime ):
89
105
__visit_name__ = "DATETIME"
@@ -108,6 +124,14 @@ def process(value):
108
124
109
125
return process
110
126
127
+ def literal_processor (self , dialect ):
128
+ def process (value ):
129
+ if isinstance (value , datetime .datetime ):
130
+ return "'%s'" % value .strftime ("%Y-%m-%d %H:%M:%S.%f" )
131
+ return value
132
+
133
+ return process
134
+
111
135
112
136
class IRISTime (sqltypes .DateTime ):
113
137
__visit_name__ = "TIME"
@@ -140,6 +164,14 @@ def process(value):
140
164
141
165
return process
142
166
167
+ def literal_processor (self , dialect ):
168
+ def process (value ):
169
+ if isinstance (value , datetime .time ):
170
+ return "'%s'" % value .strftime ("%H:%M:%S.%f" )
171
+ return value
172
+
173
+ return process
174
+
143
175
144
176
if sqlalchemy_version .startswith ("2." ):
145
177
0 commit comments