Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/postgresql/db.py
Show First 20 Lines • Show All 1,344 Lines • ▼ Show 20 Lines | def raw_extrinsic_metadata_get_by_ids(self, ids: List[Sha1Git], cur=None): | ||||
cur = self._cursor(cur) | cur = self._cursor(cur) | ||||
yield from execute_values_generator( | yield from execute_values_generator( | ||||
cur, | cur, | ||||
self._raw_extrinsic_metadata_select_query | self._raw_extrinsic_metadata_select_query | ||||
+ "INNER JOIN (VALUES %s) AS t(id) ON t.id = raw_extrinsic_metadata.id", | + "INNER JOIN (VALUES %s) AS t(id) ON t.id = raw_extrinsic_metadata.id", | ||||
[(id_,) for id_ in ids], | [(id_,) for id_ in ids], | ||||
) | ) | ||||
def raw_extrinsic_metadata_get_authorities(self, id: Sha1Git, cur=None): | def raw_extrinsic_metadata_get_authorities(self, id: str, cur=None): | ||||
cur = self._cursor(cur) | cur = self._cursor(cur) | ||||
cur.execute( | cur.execute( | ||||
""" | """ | ||||
SELECT | SELECT | ||||
DISTINCT metadata_authority.type, metadata_authority.url | DISTINCT metadata_authority.type, metadata_authority.url | ||||
FROM raw_extrinsic_metadata | FROM raw_extrinsic_metadata | ||||
INNER JOIN metadata_authority | INNER JOIN metadata_authority | ||||
ON (metadata_authority.id=authority_id) | ON (metadata_authority.id=authority_id) | ||||
▲ Show 20 Lines • Show All 113 Lines • Show Last 20 Lines |