summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES8
-rw-r--r--lib/sqlalchemy/databases/mssql.py8
2 files changed, 14 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index dc3d153c5..8b6d86c06 100644
--- a/CHANGES
+++ b/CHANGES
@@ -51,6 +51,14 @@ CHANGES
[ticket:1005]
+ - Added "odbc_options" parameter to engine / dburi
+ parameters. The given string is simply appended to the
+ SQLAlchemy-generated odbc connection string.
+
+ This should obviate the need of adding a myriad of ODBC
+ options in the future.
+
+
- firebird
- Handle the "SUBSTRING(:string FROM :start FOR :length)"
builtin.
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):