summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/connectors/pyodbc.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/connectors/pyodbc.py')
-rw-r--r--lib/sqlalchemy/connectors/pyodbc.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/sqlalchemy/connectors/pyodbc.py b/lib/sqlalchemy/connectors/pyodbc.py
index 439b8f4fe..a684a2dcb 100644
--- a/lib/sqlalchemy/connectors/pyodbc.py
+++ b/lib/sqlalchemy/connectors/pyodbc.py
@@ -37,6 +37,10 @@ class PyODBCConnector(Connector):
# if the libessqlsrv.so is detected
easysoft = False
+ def __init__(self, supports_unicode_binds=None, **kw):
+ super(PyODBCConnector, self).__init__(**kw)
+ self._user_supports_unicode_binds = supports_unicode_binds
+
@classmethod
def dbapi(cls):
return __import__('pyodbc')
@@ -119,8 +123,12 @@ class PyODBCConnector(Connector):
# have not tried pyodbc + python3.1 yet.
# Py2K
self.supports_unicode_statements = not self.freetds and not self.easysoft
- self.supports_unicode_binds = (not self.freetds or
- self.freetds_driver_version >= '0.91') and not self.easysoft
+ if self._user_supports_unicode_binds is not None:
+ self.supports_unicode_binds = self._user_supports_unicode_binds
+ else:
+ self.supports_unicode_binds = (not self.freetds or
+ self.freetds_driver_version >= '0.91'
+ ) and not self.easysoft
# end Py2K
# run other initialization which asks for user name, etc.