1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 12:29:55 +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
+10
View File
@@ -415,3 +415,13 @@ class Database(object):
}
return usage
async def get_query_columns(self):
columns = set()
for table in (UnihashesV2, OuthashesV2):
for c in table.__table__.columns:
if not isinstance(c.type, Text):
continue
columns.add(c.key)
return list(columns)