aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/src/meshbay_node/chat/store.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/chat/store.py')
-rw-r--r--packages/meshbay-node/src/meshbay_node/chat/store.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/chat/store.py b/packages/meshbay-node/src/meshbay_node/chat/store.py
index 17cd68e..9e07aff 100644
--- a/packages/meshbay-node/src/meshbay_node/chat/store.py
+++ b/packages/meshbay-node/src/meshbay_node/chat/store.py
@@ -289,6 +289,12 @@ class ChatStore:
await self._db.commit()
return cursor.rowcount
+ async def delete_all(self) -> int:
+ """The operator's purge. Returns how many rows went."""
+ cursor = await self._db.execute("DELETE FROM messages")
+ await self._db.commit()
+ return cursor.rowcount
+
async def message_count(self) -> int:
cursor = await self._db.execute("SELECT COUNT(*) FROM messages")
row = await cursor.fetchone()