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="", passwd="", *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:
def rollback(self):
self._db_con.rollback()
+
+ def savepoint(self, name):
+ self.execute("SAVEPOINT %s" % name)
+ return True
+
+ def commit_savepoint(self, name):
+ self.execute("RELEASE SAVEPOINT %s" % name)
+ return True
+
+ def rollback_savepoint(self, name):
+ self.execute("ROLLBACK TO %s" % name)
+ return True