summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/hashserv/sqlalchemy.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/hashserv/sqlalchemy.py')
-rw-r--r--bitbake/lib/hashserv/sqlalchemy.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/bitbake/lib/hashserv/sqlalchemy.py b/bitbake/lib/hashserv/sqlalchemy.py
index 873547809a..0e28d738f5 100644
--- a/bitbake/lib/hashserv/sqlalchemy.py
+++ b/bitbake/lib/hashserv/sqlalchemy.py
@@ -48,6 +48,7 @@ class UnihashesV3(Base):
48 __table_args__ = ( 48 __table_args__ = (
49 UniqueConstraint("method", "taskhash"), 49 UniqueConstraint("method", "taskhash"),
50 Index("taskhash_lookup_v4", "method", "taskhash"), 50 Index("taskhash_lookup_v4", "method", "taskhash"),
51 Index("unihash_lookup_v1", "unihash"),
51 ) 52 )
52 53
53 54
@@ -279,6 +280,16 @@ class Database(object):
279 ) 280 )
280 return map_row(result.first()) 281 return map_row(result.first())
281 282
283 async def unihash_exists(self, unihash):
284 async with self.db.begin():
285 result = await self._execute(
286 select(UnihashesV3)
287 .where(UnihashesV3.unihash == unihash)
288 .limit(1)
289 )
290
291 return result.first() is not None
292
282 async def get_outhash(self, method, outhash): 293 async def get_outhash(self, method, outhash):
283 async with self.db.begin(): 294 async with self.db.begin():
284 result = await self._execute( 295 result = await self._execute(