Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/db.py
Show First 20 Lines • Show All 961 Lines • ▼ Show 20 Lines | def content_fossology_license_get_from_temp(self, cur=None): | ||||
""" | """ | ||||
cur = self._cursor(cur) | cur = self._cursor(cur) | ||||
query = "SELECT %s FROM swh_content_fossology_license_get()" % ( | query = "SELECT %s FROM swh_content_fossology_license_get()" % ( | ||||
','.join(self.content_fossology_license_cols)) | ','.join(self.content_fossology_license_cols)) | ||||
cur.execute(query) | cur.execute(query) | ||||
yield from cursor_to_bytes(cur) | yield from cursor_to_bytes(cur) | ||||
content_metadata_cols = [ | |||||
'id', 'translated_metadata', | |||||
'tool_id', 'tool_name', 'tool_version', 'tool_configuration'] | |||||
@stored_procedure('swh_mktemp_content_metadata') | |||||
def mktemp_content_metadata(self, cur=None): pass | |||||
@stored_procedure('swh_mktemp_content_metadata_missing') | |||||
def mktemp_content_metadata_missing(self, cur=None): pass | |||||
def content_metadata_missing_from_temp(self, cur=None): | |||||
"""List missing metadatas. | |||||
""" | |||||
cur = self._cursor(cur) | |||||
cur.execute("SELECT * FROM swh_content_metadata_missing()") | |||||
yield from cursor_to_bytes(cur) | |||||
def content_metadata_add_from_temp(self, conflict_update, cur=None): | |||||
self._cursor(cur).execute("SELECT swh_content_metadata_add(%s)", | |||||
(conflict_update, )) | |||||
def content_metadata_get_from_temp(self, cur=None): | |||||
cur = self._cursor(cur) | |||||
query = "SELECT %s FROM swh_content_metadata_get()" % ( | |||||
','.join(self.content_metadata_cols)) | |||||
cur.execute(query) | |||||
yield from cursor_to_bytes(cur) | |||||
indexer_configuration_cols = ['id', 'tool_name', 'tool_version', | indexer_configuration_cols = ['id', 'tool_name', 'tool_version', | ||||
'tool_configuration'] | 'tool_configuration'] | ||||
def indexer_configuration_get(self, tool_name, | def indexer_configuration_get(self, tool_name, | ||||
tool_version, tool_configuration, cur=None): | tool_version, tool_configuration, cur=None): | ||||
cur = self._cursor(cur) | cur = self._cursor(cur) | ||||
cur.execute('''select %s | cur.execute('''select %s | ||||
from indexer_configuration | from indexer_configuration | ||||
Show All 10 Lines |