Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/postgresql/db.py
# Copyright (C) 2015-2021 The Software Heritage developers | # Copyright (C) 2015-2021 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
import datetime | import datetime | ||||
import logging | import logging | ||||
import random | import random | ||||
import select | import select | ||||
from typing import Any, Dict, Iterable, List, Optional, Tuple | from typing import Any, Dict, Iterable, List, Optional, Tuple | ||||
from swh.core.db import BaseDb | from swh.core.db import BaseDb | ||||
from swh.core.db.db_utils import execute_values_generator | from swh.core.db.db_utils import execute_values_generator | ||||
from swh.core.db.db_utils import jsonize as _jsonize | from swh.core.db.db_utils import jsonize as _jsonize | ||||
from swh.core.db.db_utils import stored_procedure | from swh.core.db.db_utils import stored_procedure | ||||
from swh.model.hashutil import DEFAULT_ALGORITHMS | from swh.model.hashutil import DEFAULT_ALGORITHMS | ||||
from swh.model.identifiers import ObjectType | |||||
from swh.model.model import SHA1_SIZE, OriginVisit, OriginVisitStatus, Sha1Git | from swh.model.model import SHA1_SIZE, OriginVisit, OriginVisitStatus, Sha1Git | ||||
from swh.model.swhids import ObjectType | |||||
from swh.storage.interface import ListOrder | from swh.storage.interface import ListOrder | ||||
logger = logging.getLogger(__name__) | logger = logging.getLogger(__name__) | ||||
def jsonize(d): | def jsonize(d): | ||||
return _jsonize(dict(d) if d is not None else None) | return _jsonize(dict(d) if d is not None else None) | ||||
▲ Show 20 Lines • Show All 1,467 Lines • Show Last 20 Lines |