mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user