def getObject(self, key, bucket): if not self._bucket_exists(bucket): return key, None c = self.conn.execute("SELECT key, value from `{}` WHERE key=?" .format(hash(bucket)), (key,)) row = c.fetchone() if row: k, v = row return (k, dejsonify(decompress(v))) else: return key, None
def getObject(self, key, bucket): if not self._bucket_exists(bucket): return key, None c = self.conn.execute("SELECT key, value from `{}` WHERE key=?" .format(hash(bucket)), (key,)) row = c.fetchone() if row: k, v = row return (k, dejsonify(decompress(v).decode('utf-8'))) else: return key, None
def getAllObjects(self, bucket): if not self._bucket_exists(bucket): return for k, v in self.conn.execute("SELECT key, value from `{}`" .format(hash(bucket))): yield (k, dejsonify(decompress(v)))
def getAllObjects(self, bucket): if not self._bucket_exists(bucket): return for k, v in self.conn.execute("SELECT key, value from `{}`".format( hash(bucket))): yield (k, dejsonify(decompress(v)))