aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hashserv/client.py
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2023-11-03 08:26:34 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-11-09 17:21:15 +0000
commitabfce2b68bdab02ea2e9a63fbb3b9e270428a0a6 (patch)
treed0a12b4b5c603867142dddd17fe5e054ae0b1e3b /lib/hashserv/client.py
parentc9c1224447e147e0de92953bc85cea75670b898c (diff)
downloadbitbake-abfce2b68bdab02ea2e9a63fbb3b9e270428a0a6.tar.gz
hashserv: Add database column query API
Adds an API to retrieve the columns that can be queried on from the database backend. This prevents front end applications from needing to hardcode the query columns Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/hashserv/client.py')
-rw-r--r--lib/hashserv/client.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/hashserv/client.py b/lib/hashserv/client.py
index 5e0a462b1..35a97687f 100644
--- a/lib/hashserv/client.py
+++ b/lib/hashserv/client.py
@@ -190,6 +190,10 @@ class AsyncClient(bb.asyncrpc.AsyncClient):
await self._set_mode(self.MODE_NORMAL)
return (await self.invoke({"get-db-usage": {}}))["usage"]
+ async def get_db_query_columns(self):
+ await self._set_mode(self.MODE_NORMAL)
+ return (await self.invoke({"get-db-query-columns": {}}))["columns"]
+
class Client(bb.asyncrpc.Client):
def __init__(self, username=None, password=None):
@@ -219,6 +223,7 @@ class Client(bb.asyncrpc.Client):
"delete_user",
"become_user",
"get_db_usage",
+ "get_db_query_columns",
)
def _get_async_client(self):