Changeset View
Changeset View
Standalone View
Standalone View
swh/provenance/postgresql/provenancedb_with_path.py
# Copyright (C) 2021 The Software Heritage developers | |||||
# See the AUTHORS file at the top-level directory of this distribution | |||||
# License: GNU General Public License version 3, or any later version | |||||
# See top-level LICENSE file for more information | |||||
from typing import Generator, Optional | from typing import Generator, Optional | ||||
from swh.model.model import Sha1Git | from swh.model.model import Sha1Git | ||||
from ..provenance import ProvenanceResult, RelationType | from ..interface import ProvenanceResult, RelationType | ||||
from .provenancedb_base import ProvenanceDBBase | from .provenancedb_base import ProvenanceDBBase | ||||
class ProvenanceWithPathDB(ProvenanceDBBase): | class ProvenanceWithPathDB(ProvenanceDBBase): | ||||
def content_find_first(self, id: Sha1Git) -> Optional[ProvenanceResult]: | def content_find_first(self, id: Sha1Git) -> Optional[ProvenanceResult]: | ||||
sql = """ | sql = """ | ||||
SELECT C.sha1 AS content, | SELECT C.sha1 AS content, | ||||
R.sha1 AS revision, | R.sha1 AS revision, | ||||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |