]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- support for SSL arguments given as inline within URL query string,
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 22 Apr 2007 17:49:59 +0000 (17:49 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 22 Apr 2007 17:49:59 +0000 (17:49 +0000)
prefixed with "ssl_", courtesy terjeros@gmail.com.

CHANGES
lib/sqlalchemy/databases/mysql.py

diff --git a/CHANGES b/CHANGES
index c05f969ceb7fe562d37db070319c578894aa552c..76a7edda06500d01ee9583b73493839d7e91a03d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
       which features LIMIT/OFFSET.  oracle dialect needs to modify
       the object to have ROW_NUMBER OVER and wasn't performing 
       the full series of steps on successive compiles.
-
+- mysql
+    - support for SSL arguments given as inline within URL query string,
+      prefixed with "ssl_", courtesy terjeros@gmail.com.
+      
 0.3.6
 - sql:
     - bindparam() names are now repeatable!  specify two
index 52aa03003d36365876f330ddd081535047a50ae7..cc503215ae6caae142072432c47a9bc0affc5c58 100644 (file)
@@ -293,8 +293,18 @@ class MySQLDialect(ansisql.ANSIDialect):
         # note: these two could break SA Unicode type
         util.coerce_kw_type(opts, 'use_unicode', bool)   
         util.coerce_kw_type(opts, 'charset', str)
-        # TODO: what about options like "ssl", "cursorclass" and "conv" ?
-
+        
+        # ssl
+        ssl = {}
+        for key in ['ssl_ca', 'ssl_key', 'ssl_cert', 'ssl_capath', 'ssl_cipher']:
+            if key in opts:
+                ssl[key[4:]] = opts[key]
+                util.coerce_kw_type(ssl, key[4:], str)
+                del opts[key]
+        if len(ssl):
+            opts['ssl'] = ssl
+
+        # TODO: what about options like "cursorclass" and "conv" ?
         client_flag = opts.get('client_flag', 0)
         if self.dbapi is not None:
             try:
@@ -302,7 +312,7 @@ class MySQLDialect(ansisql.ANSIDialect):
                 client_flag |= CLIENT_FLAGS.FOUND_ROWS
             except:
                 pass
-        opts['client_flag'] = client_flag
+            opts['client_flag'] = client_flag
         return [[], opts]
 
     def create_execution_context(self, *args, **kwargs):