Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/storage/db.py
Show First 20 Lines • Show All 481 Lines • ▼ Show 20 Lines | ): | ||||
args = [] | args = [] | ||||
where = [] | where = [] | ||||
if last: | if last: | ||||
where.append("oim.id > %s") | where.append("oim.id > %s") | ||||
args.append(last) | args.append(last) | ||||
if mappings is not None: | if mappings is not None: | ||||
where.append("oim.mappings && %s") | where.append("oim.mappings && %s") | ||||
args.append(mappings) | args.append(list(mappings)) | ||||
if tool_ids is not None: | if tool_ids is not None: | ||||
where.append("oim.indexer_configuration_id = ANY(%s)") | where.append("oim.indexer_configuration_id = ANY(%s)") | ||||
args.append(tool_ids) | args.append(list(tool_ids)) | ||||
olasd: I believe you could use `list` unconditionally here. | |||||
if where: | if where: | ||||
query_parts.append("WHERE") | query_parts.append("WHERE") | ||||
query_parts.append(" AND ".join(where)) | query_parts.append(" AND ".join(where)) | ||||
if limit: | if limit: | ||||
query_parts.append("LIMIT %s") | query_parts.append("LIMIT %s") | ||||
args.append(limit) | args.append(limit) | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |
I believe you could use list unconditionally here.