Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/db.py
Show First 20 Lines • Show All 1,090 Lines • ▼ Show 20 Lines | ) -> None: | ||||
format: the format of the metadata | format: the format of the metadata | ||||
metadata: the metadata retrieved at the time and location | metadata: the metadata retrieved at the time and location | ||||
""" | """ | ||||
cur = self._cursor(cur) | cur = self._cursor(cur) | ||||
insert = """INSERT INTO origin_metadata (origin_id, discovery_date, | insert = """INSERT INTO origin_metadata (origin_id, discovery_date, | ||||
authority_id, fetcher_id, format, metadata) | authority_id, fetcher_id, format, metadata) | ||||
SELECT id, %s, %s, %s, %s, %s FROM origin WHERE url = %s""" | SELECT id, %s, %s, %s, %s, %s FROM origin WHERE url = %s""" | ||||
cur.execute( | cur.execute( | ||||
insert, | insert, (discovery_date, authority, fetcher, format, metadata, origin), | ||||
(discovery_date, authority, fetcher, format, jsonize(metadata), origin), | |||||
) | ) | ||||
def origin_metadata_get( | def origin_metadata_get( | ||||
self, | self, | ||||
origin_url: str, | origin_url: str, | ||||
authority: int, | authority: int, | ||||
after: Optional[datetime.datetime], | after: Optional[datetime.datetime], | ||||
limit: Optional[int], | limit: Optional[int], | ||||
▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines |