diff --git a/lib/nntp/tiny/db.py b/lib/nntp/tiny/db.py index 2eca781..6b398ff 100644 --- a/lib/nntp/tiny/db.py +++ b/lib/nntp/tiny/db.py @@ -43,6 +43,15 @@ class DatabaseTableCursor(): def fetchall(self): return map(self.__map__, self.cr.fetchall()) + def each(self): + while True: + obj = self.fetchone() + + if obj is None: + break + + yield obj + class Database(): __slots__ = 'db',