+ def get1(self, *, check=False, default=KeyError, **kwargs):
+ with self.get(**kwargs) as cursor:
+ try:
+ k, v = next(cursor)
+ except StopIteration:
+ if default is not KeyError:
+ return default
+ raise KeyError("no matches in " + self.name, kwargs)
+ if check:
+ try:
+ next(cursor)
+ except StopIteration:
+ pass
+ else:
+ raise ValueError("unexpected multiple matchies in " + self.name, kwargs)
+ return v
+
+ def list(self, **kwargs):
+ with self.get(**kwargs) as cursor:
+ return [v for k, v in cursor]
+