]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
merge changset [3347] into trunk
authorPaul Johnston <paj@pajhome.org.uk>
Fri, 17 Aug 2007 18:00:30 +0000 (18:00 +0000)
committerPaul Johnston <paj@pajhome.org.uk>
Fri, 17 Aug 2007 18:00:30 +0000 (18:00 +0000)
CHANGES
lib/sqlalchemy/databases/mssql.py

diff --git a/CHANGES b/CHANGES
index 0e12026e90a2ace27fb29ab1ccdb5090d98b4008..81505bf5abb01357e69c855cad2c298100188897 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -446,6 +446,7 @@ CHANGES
       SQL_VARIANT [ticket:721]
     - index names are now quoted when dropping from reflected tables
       [ticket:684]
+    - can now specify a DSN for PyODBC, using a URI like mssql:///?dsn=bob
 - postgres
     - when reflecting tables from alternate schemas, the "default" placed upon
       the primary key, i.e. usually a sequence name, has the "schema" name
index 25238c6979115fa6f7cdc1126f387b151bfa47cd..619e072d911e315242260ada50d6ba2904a7eabc 100644 (file)
@@ -791,15 +791,19 @@ class MSSQLDialect_pyodbc(MSSQLDialect):
 
     def supports_unicode_statements(self):
         """indicate whether the DBAPI can receive SQL statements as Python unicode strings"""
+        # PyODBC unicode is broken on UCS-4 builds
         return sys.maxunicode == 65535
 
     def make_connect_string(self, keys):
-        connectors = ["Driver={SQL Server}"]
-        if 'port' in keys:
-            connectors.append('Server=%s,%d' % (keys.get('host'), keys.get('port')))
+        if 'dsn' in keys:
+            connectors = ['dsn=%s' % keys['dsn']]
         else:
-            connectors.append('Server=%s' % keys.get('host'))
-        connectors.append("Database=%s" % keys.get("database"))
+            connectors = ["Driver={SQL Server}"]
+            if 'port' in keys:
+                connectors.append('Server=%s,%d' % (keys.get('host'), keys.get('port')))
+            else:
+                connectors.append('Server=%s' % keys.get('host'))
+            connectors.append("Database=%s" % keys.get("database"))
         user = keys.get("user")
         if user:
             connectors.append("UID=%s" % user)