diff options
author | Rick Morrison <rickmorrison@gmail.com> | 2008-04-17 19:07:12 +0000 |
---|---|---|
committer | Rick Morrison <rickmorrison@gmail.com> | 2008-04-17 19:07:12 +0000 |
commit | c94ccaf932b769a85ae43aa1ebaeff250e49cc58 (patch) | |
tree | a39d8c61b47df4bf2afda057d7e5696dac4a381f /lib/sqlalchemy | |
parent | 24797113708c0f19ef0d5d81e2950b33f8c1a425 (diff) | |
download | sqlalchemy-c94ccaf932b769a85ae43aa1ebaeff250e49cc58.tar.gz |
Added 'odbc_options' keyword to the MSSQL dialect. Allows a partial ODBC connection string to be passed through to the connection string generator.
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r-- | lib/sqlalchemy/databases/mssql.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/sqlalchemy/databases/mssql.py b/lib/sqlalchemy/databases/mssql.py index 6cc5f4fd3..55d4b7cf2 100644 --- a/lib/sqlalchemy/databases/mssql.py +++ b/lib/sqlalchemy/databases/mssql.py @@ -345,7 +345,6 @@ class MSSQLExecutionContext(default.DefaultExecutionContext): self.cursor.execute("SELECT @@identity AS lastrowid") row = self.cursor.fetchone() self._last_inserted_ids = [int(row[0])] + self._last_inserted_ids[1:] - # print "LAST ROW ID", self._last_inserted_ids super(MSSQLExecutionContext, self).post_exec() _ms_is_select = re.compile(r'\s*(?:SELECT|sp_columns|EXEC)', @@ -799,7 +798,12 @@ class MSSQLDialect_pyodbc(MSSQLDialect): # This should obviously be set to 'No' if you query a cp1253 encoded # database from a latin1 client... if 'odbc_autotranslate' in keys: - connectors.append("AutoTranslate=%s" % keys.pop("odbc_autotranslate")) + connectors.append("AutoTranslate=%s" % keys.pop("odbc_autotranslate")) + + # Allow specification of partial ODBC connect string + if 'odbc_options' in keys: + connectors.append(keys.pop('odbc_options')) + return [[";".join (connectors)], {}] def is_disconnect(self, e): |