from .base import MySQLDialect
from .base import MySQLExecutionContext
+from .types import TIME
from ... import util
from ...connectors.pyodbc import PyODBCConnector
+class _pyodbcTIME(TIME):
+ def result_processor(self, dialect, coltype):
+ def process(value):
+ # pyodbc already returns a datetime.time object, so no need to convert
+ return value
+
+ return process
+
+
class MySQLExecutionContext_pyodbc(MySQLExecutionContext):
def get_lastrowid(self):
cursor = self.create_cursor()
class MySQLDialect_pyodbc(PyODBCConnector, MySQLDialect):
+ colspecs = util.update_copy(MySQLDialect.colspecs, {TIME: _pyodbcTIME})
supports_unicode_statements = False
execution_ctx_cls = MySQLExecutionContext_pyodbc