]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Added a new 'max_identifier_length' keyword to the mssql_pyodbc dialect
authorRick Morrison <rickmorrison@gmail.com>
Wed, 2 Apr 2008 23:03:00 +0000 (23:03 +0000)
committerRick Morrison <rickmorrison@gmail.com>
Wed, 2 Apr 2008 23:03:00 +0000 (23:03 +0000)
CHANGES
lib/sqlalchemy/databases/mssql.py

diff --git a/CHANGES b/CHANGES
index 522eaf1a84f6e589f1769f4ef991138bfa6c6e98..70ca76c30738a995ca74c4571c007ba1417b7c6d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -261,6 +261,9 @@ CHANGES
        dialect.  Will substitute into the ODBC connection string
        if given, defaults to 'SQL Server'.
 
+     - Added a new 'max_identifier_length' keyword parameter
+       for the pyodbc dialect. 
+
      - Improvements to pyodbc + Unix. If you couldn't get that
        combination to work before, please try again.
 
index 849d5850716be06645cde1e85f476015060a98cd..e0bf2e6bb601ba0e621de86769723a3492be50a2 100644 (file)
@@ -741,6 +741,7 @@ class MSSQLDialect_pymssql(MSSQLDialect):
     def is_disconnect(self, e):
         return isinstance(e, self.dbapi.DatabaseError) and "Error 10054" in str(e)
 
+
 class MSSQLDialect_pyodbc(MSSQLDialect):
     supports_sane_rowcount = False
     supports_sane_multi_rowcount = False
@@ -775,10 +776,12 @@ class MSSQLDialect_pyodbc(MSSQLDialect):
     ischema_names['datetime'] = MSDateTime_pyodbc
 
     def make_connect_string(self, keys):
+        if 'max_identifier_length' in keys:
+            self.max_identifier_length = int(keys.pop('max_identifier_length'))
         if 'dsn' in keys:
             connectors = ['dsn=%s' % keys['dsn']]
         else:
-            connectors = ["DRIVER={%s}" % keys.get('driver', 'SQL Server'),
+            connectors = ["DRIVER={%s}" % keys.pop('driver', 'SQL Server'),
                           'Server=%s' % keys['host'],
                           'Database=%s' % keys['database'] ]
             if 'port' in keys: