chore: rename "InsertOrUpdate" to Upsert around the codebase (#6823)

* chore: rename "InsertOrUpdate" to Upsert around the codebase

The shorter name uses up less line width, is easier to read
and is used more often.

* make gen
This commit is contained in:
Ammar Bandukwala
2023-03-28 00:55:10 +00:00
committed by GitHub
parent f88f273cd6
commit 42b3d90221
10 changed files with 33 additions and 33 deletions
+9 -9
View File
@@ -3103,33 +3103,33 @@ func (q *sqlQuerier) InsertDeploymentID(ctx context.Context, value string) error
return err
}
const insertOrUpdateLastUpdateCheck = `-- name: InsertOrUpdateLastUpdateCheck :exec
const upsertLastUpdateCheck = `-- name: UpsertLastUpdateCheck :exec
INSERT INTO site_configs (key, value) VALUES ('last_update_check', $1)
ON CONFLICT (key) DO UPDATE SET value = $1 WHERE site_configs.key = 'last_update_check'
`
func (q *sqlQuerier) InsertOrUpdateLastUpdateCheck(ctx context.Context, value string) error {
_, err := q.db.ExecContext(ctx, insertOrUpdateLastUpdateCheck, value)
func (q *sqlQuerier) UpsertLastUpdateCheck(ctx context.Context, value string) error {
_, err := q.db.ExecContext(ctx, upsertLastUpdateCheck, value)
return err
}
const insertOrUpdateLogoURL = `-- name: InsertOrUpdateLogoURL :exec
const upsertLogoURL = `-- name: UpsertLogoURL :exec
INSERT INTO site_configs (key, value) VALUES ('logo_url', $1)
ON CONFLICT (key) DO UPDATE SET value = $1 WHERE site_configs.key = 'logo_url'
`
func (q *sqlQuerier) InsertOrUpdateLogoURL(ctx context.Context, value string) error {
_, err := q.db.ExecContext(ctx, insertOrUpdateLogoURL, value)
func (q *sqlQuerier) UpsertLogoURL(ctx context.Context, value string) error {
_, err := q.db.ExecContext(ctx, upsertLogoURL, value)
return err
}
const insertOrUpdateServiceBanner = `-- name: InsertOrUpdateServiceBanner :exec
const upsertServiceBanner = `-- name: UpsertServiceBanner :exec
INSERT INTO site_configs (key, value) VALUES ('service_banner', $1)
ON CONFLICT (key) DO UPDATE SET value = $1 WHERE site_configs.key = 'service_banner'
`
func (q *sqlQuerier) InsertOrUpdateServiceBanner(ctx context.Context, value string) error {
_, err := q.db.ExecContext(ctx, insertOrUpdateServiceBanner, value)
func (q *sqlQuerier) UpsertServiceBanner(ctx context.Context, value string) error {
_, err := q.db.ExecContext(ctx, upsertServiceBanner, value)
return err
}