Ejemplo n.º 1
0
 def iterkeys(self):
     """Iterate for every key in a fixed-length database object."""
     if not tc.fdb_iterinit(self.db):
         raise tc.TCException(tc.fdb_errmsg(tc.fdb_ecode(self.db)))
     while True:
         key = tc.fdb_iternext(self.db)
         if not key:
             break
         yield key
Ejemplo n.º 2
0
 def itervalues(self):
     """Iterate for every value in a fixed-length database object."""
     if not tc.fdb_iterinit(self.db):
         raise tc.TCException(tc.fdb_errmsg(tc.fdb_ecode(self.db)))
     while True:
         key = tc.fdb_iternext3(self.db)
         if not key:
             break
         value = tc.fdb_get3(self.db, key)
         yield value.value
Ejemplo n.º 3
0
 def itervalues(self, as_type=None):
     """Iterate for every value in a fixed-length database object."""
     if not tc.fdb_iterinit(self.db):
         raise tc.TCException(tc.fdb_errmsg(tc.fdb_ecode(self.db)))
     while True:
         key = tc.fdb_iternext(self.db)
         if not key:
             break
         (c_value, c_value_len) = tc.fdb_get(self.db, key)
         value = util.deserialize(c_value, c_value_len, as_type)
         yield value