1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 13:09:50 +00:00

bitbake: 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

(Bitbake rev: abfce2b68bdab02ea2e9a63fbb3b9e270428a0a6)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Joshua Watt
2023-11-03 08:26:34 -06:00
committed by Richard Purdie
parent 3a2c5a6fa2
commit c1574ae46f
6 changed files with 42 additions and 0 deletions
+5
View File
@@ -250,6 +250,7 @@ class ServerClient(bb.asyncrpc.AsyncServerConnection):
"get-stream": self.handle_get_stream,
"get-stats": self.handle_get_stats,
"get-db-usage": self.handle_get_db_usage,
"get-db-query-columns": self.handle_get_db_query_columns,
# Not always read-only, but internally checks if the server is
# read-only
"report": self.handle_report,
@@ -572,6 +573,10 @@ class ServerClient(bb.asyncrpc.AsyncServerConnection):
async def handle_get_db_usage(self, request):
return {"usage": await self.db.get_usage()}
@permissions(DB_ADMIN_PERM)
async def handle_get_db_query_columns(self, request):
return {"columns": await self.db.get_query_columns()}
# The authentication API is always allowed
async def handle_auth(self, request):
username = str(request["username"])