]> git.jsancho.org Git - mojodb.git/blobdiff - MySQL.py
Custom serializer in connection object; default is msgpack
[mojodb.git] / MySQL.py
index e983a670fa957f2d082f21b6c41a729512a05716..98365b4d50d22629584ae39db071cd33cf8e7ae2 100644 (file)
--- a/MySQL.py
+++ b/MySQL.py
@@ -84,9 +84,10 @@ class Connection(connection.Connection):
     Constraint = Constraint
     Literal = Literal
 
-    def __init__(self, *args, **kwargs):
-        self._db_con = MySQLdb.connect(*args, **kwargs)
-        self._db_con_autocommit = MySQLdb.connect(*args, **kwargs)
+    def __init__(self, host="localhost", user=None, passwd=None, *args, **kwargs):
+        self._db_con = MySQLdb.connect(host=host, user=user, passwd=passwd)
+        self._db_con_autocommit = MySQLdb.connect(host=host, user=user, passwd=passwd)
+        super(Connection, self).__init__(*args, **kwargs)
 
     def query(self, sql, db=None):
         if db is None: