

def execute_sql(self, sql, params=None, require_commit=True):
    logger.debug((sql, params))
    with self.exception_wrapper():
        cursor = self.get_cursor()
        try:
            cursor.execute(sql, (params or ()))
        except Exception:
            if (self.get_autocommit() and self.autorollback):
                self.rollback()
            raise
        else:
            if (require_commit and self.get_autocommit()):
                self.commit()
    return self

dataset/ETHPy150Open coleifer/peewee/peewee.py Database.execute_sql/VarMisuse@124/144 `cursor`->`self`