summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/connectors/pyodbc.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-04-01 19:42:54 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2012-04-01 19:42:54 -0400
commit47a799ecd5d03b78e5d67918302c0da2950d27b8 (patch)
treeef349b936cfe7b158f065459d931409465cfe618 /lib/sqlalchemy/connectors/pyodbc.py
parent2563b33453dee1b55500f13421b7b50ba367a504 (diff)
downloadsqlalchemy-47a799ecd5d03b78e5d67918302c0da2950d27b8.tar.gz
- sql
- [bug] Removed warning when Index is created with no columns; while this might not be what the user intended, it is a valid use case as an Index could be a placeholder for just an index of a certain name. - mssql - [feature] Added interim create_engine flag supports_unicode_binds to PyODBC dialect, to force whether or not the dialect passes Python unicode literals to PyODBC or not.
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.