mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2026-09-28 01:56:38 -04:00
Fetch only value in get_object (#17320)
Fetch only value in get_object.
This commit is contained in:
@@ -29,14 +29,14 @@ class KeyValStore:
|
||||
"""
|
||||
|
||||
async with self.db_wrapper.reader_no_transaction() as conn:
|
||||
cursor = await conn.execute("SELECT * from key_val_store WHERE key=?", (key,))
|
||||
cursor = await conn.execute("SELECT value from key_val_store WHERE key=?", (key,))
|
||||
row = await cursor.fetchone()
|
||||
await cursor.close()
|
||||
|
||||
if row is None:
|
||||
return None
|
||||
|
||||
return object_type.from_bytes(row[1])
|
||||
return object_type.from_bytes(row[0])
|
||||
|
||||
async def set_object(self, key: str, obj: Any):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user