From c1574ae46f7a5701d79f2c1d333094a5d5919a46 Mon Sep 17 00:00:00 2001 From: Joshua Watt Date: Fri, 3 Nov 2023 08:26:34 -0600 Subject: 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 Signed-off-by: Richard Purdie --- bitbake/lib/hashserv/tests.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bitbake/lib/hashserv/tests.py') diff --git a/bitbake/lib/hashserv/tests.py b/bitbake/lib/hashserv/tests.py index 9d5bec2454..fc69acaf7c 100644 --- a/bitbake/lib/hashserv/tests.py +++ b/bitbake/lib/hashserv/tests.py @@ -776,6 +776,14 @@ class HashEquivalenceCommonTests(object): self.assertIn("rows", usage[name]) self.assertTrue(isinstance(usage[name]["rows"], int)) + def test_get_db_query_columns(self): + columns = self.client.get_db_query_columns() + + self.assertTrue(isinstance(columns, list)) + self.assertTrue(len(columns) > 0) + + for col in columns: + self.client.remove({col: ""}) class TestHashEquivalenceUnixServer(HashEquivalenceTestSetup, HashEquivalenceCommonTests, unittest.TestCase): def get_server_addr(self, server_idx): -- cgit v1.2.3-54-g00ecf