def execute(self, sql, select=True):
    self._cur.execute(sql)
    if select:
        while True:
            result = self._cur.fetchone()
            if result:
                (yield result)
            else:
                break
    else:
        result = self._cur.fetchall()
        return result
def execute(self, sql, select=True):
    self._cur.execute(sql)
    if select:
        while True:
            result = self._cur.fetchone()
            if result:
                (yield result)
            else:
                break
    else:
        result = self._cur.fetchall()
        return result