Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/postgresql/db.py
Show First 20 Lines • Show All 1,156 Lines • ▼ Show 20 Lines | |||||
] | ] | ||||
"""List of columns of the raw_extrinsic_metadata table, used when writing | """List of columns of the raw_extrinsic_metadata table, used when writing | ||||
metadata.""" | metadata.""" | ||||
_raw_extrinsic_metadata_insert_query = f""" | _raw_extrinsic_metadata_insert_query = f""" | ||||
INSERT INTO raw_extrinsic_metadata | INSERT INTO raw_extrinsic_metadata | ||||
({', '.join(_raw_extrinsic_metadata_insert_cols)}) | ({', '.join(_raw_extrinsic_metadata_insert_cols)}) | ||||
VALUES ({', '.join('%s' for _ in _raw_extrinsic_metadata_insert_cols)}) | VALUES ({', '.join('%s' for _ in _raw_extrinsic_metadata_insert_cols)}) | ||||
ON CONFLICT (target, authority_id, discovery_date, fetcher_id) | ON CONFLICT (id) | ||||
DO NOTHING | DO NOTHING | ||||
""" | """ | ||||
raw_extrinsic_metadata_get_cols = [ | raw_extrinsic_metadata_get_cols = [ | ||||
"raw_extrinsic_metadata.target", | "raw_extrinsic_metadata.target", | ||||
"raw_extrinsic_metadata.type", | "raw_extrinsic_metadata.type", | ||||
"discovery_date", | "discovery_date", | ||||
"metadata_authority.type", | "metadata_authority.type", | ||||
▲ Show 20 Lines • Show All 204 Lines • Show Last 20 Lines |