]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Added 'odbc_options' keyword to the MSSQL dialect. Allows a partial ODBC connection...
authorRick Morrison <rickmorrison@gmail.com>
Thu, 17 Apr 2008 19:07:12 +0000 (19:07 +0000)
committerRick Morrison <rickmorrison@gmail.com>
Thu, 17 Apr 2008 19:07:12 +0000 (19:07 +0000)
CHANGES
lib/sqlalchemy/databases/mssql.py

diff --git a/CHANGES b/CHANGES
index dc3d153c5fc49f886547e08acb29c31f1102a92f..8b6d86c06217db16c0bd7bb4ded3c08e666cbf83 100644 (file)
--- 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.
index 6cc5f4fd34c0c6b93051ba48fc9cf30e143680b2..55d4b7cf24bb9ba7b7159e92568c2f286514f1d4 100644 (file)
@@ -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):