Skip to content

repo-updater: db store always inserts verbatim repo fields and only returns id on insert

Administrator requested to merge core/only-scan-inserts into master

Created by: keegancsmith

Sorry for the long title :) Review commit by commit.

This is doing some cleanup in our SQL statements in the repo-updater store. It is motivated by some SQL changes I will be making for soft-deletion support:

  • external ids are always set and is enforced as a constraints, so remove coalesce and nullif
  • we always set updated_at and created_at in the syncer code, so remove nullif. However, these fields can be null according to schema. Will follow-up with updating our schema to prevent nulls on these fields.
  • insert is the only time we actually need to scan the mutation, and in that case we want to get the ID only. So remove scanning on update and delete. Also only return the id.

Part of https://github.com/sourcegraph/sourcegraph/issues/6859

Merge request reports

Loading