diff options
author | Joshua Watt <JPEWhacker@gmail.com> | 2023-11-03 08:26:34 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-11-09 17:33:03 +0000 |
commit | c1574ae46f7a5701d79f2c1d333094a5d5919a46 (patch) | |
tree | 1dd237ed9b65dd29000fbf9acdd3c5d4eb86f4f3 /bitbake/lib/hashserv/sqlalchemy.py | |
parent | 3a2c5a6fa2e0081c28d5f2f43e1d9a79d093ea37 (diff) | |
download | poky-c1574ae46f7a5701d79f2c1d333094a5d5919a46.tar.gz |
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>
Diffstat (limited to 'bitbake/lib/hashserv/sqlalchemy.py')
-rw-r--r-- | bitbake/lib/hashserv/sqlalchemy.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bitbake/lib/hashserv/sqlalchemy.py b/bitbake/lib/hashserv/sqlalchemy.py index 818b51951b..cee04bffb0 100644 --- a/bitbake/lib/hashserv/sqlalchemy.py +++ b/bitbake/lib/hashserv/sqlalchemy.py | |||
@@ -415,3 +415,13 @@ class Database(object): | |||
415 | } | 415 | } |
416 | 416 | ||
417 | return usage | 417 | return usage |
418 | |||
419 | async def get_query_columns(self): | ||
420 | columns = set() | ||
421 | for table in (UnihashesV2, OuthashesV2): | ||
422 | for c in table.__table__.columns: | ||
423 | if not isinstance(c.type, Text): | ||
424 | continue | ||
425 | columns.add(c.key) | ||
426 | |||
427 | return list(columns) | ||