You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2020/09/07 20:04:29 UTC
[incubator-ponymail-foal] 01/10: Add wrappers for delete and index
This is an automated email from the ASF dual-hosted git repository.
humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git
commit 04a17a69780a403627ecfcd2694f3ce8559e5b4d
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Mon Sep 7 21:55:07 2020 +0200
Add wrappers for delete and index
---
server/plugins/database.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/server/plugins/database.py b/server/plugins/database.py
index 0739ee7..910073a 100644
--- a/server/plugins/database.py
+++ b/server/plugins/database.py
@@ -71,3 +71,15 @@ class Database:
index = self.dbs.mbox
res = await self.client.get(index=index, **kwargs)
return res
+
+ async def delete(self, index="", **kwargs):
+ if not index:
+ index = self.dbs.session
+ res = await self.client.delete(index=index, **kwargs)
+ return res
+
+ async def index(self, index="", **kwargs):
+ if not index:
+ index = self.dbs.session
+ res = await self.client.index(index=index, **kwargs)
+ return res