fix: query for SQLite
This commit is contained in:
parent
339f2b70c1
commit
55f9142f3d
1 changed files with 1 additions and 1 deletions
2
crud.py
2
crud.py
|
|
@ -120,7 +120,7 @@ async def get_event(relay_id: str, id: str) -> Optional[NostrEvent]:
|
|||
async def get_storage_for_public_key(relay_id: str, pubkey: str) -> int:
|
||||
"""Returns the storage space in bytes for all the events of a public key. Deleted events are also counted"""
|
||||
|
||||
row = await db.fetchone("SELECT SUM(size) FROM nostrrelay.events WHERE relay_id = ? AND pubkey = ?", (relay_id, pubkey,))
|
||||
row = await db.fetchone("SELECT SUM(size) as sum FROM nostrrelay.events WHERE relay_id = ? AND pubkey = ? GROUP BY pubkey", (relay_id, pubkey,))
|
||||
if not row:
|
||||
return 0
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue