MCPcopy Index your code
hub / github.com/bytebase/bytebase / DeleteSetting

Method DeleteSetting

backend/store/setting.go:373–386  ·  view source on GitHub ↗

DeleteSetting deletes a setting by the name.

(ctx context.Context, workspace string, name storepb.SettingName)

Source from the content-addressed store, hash-verified

371
372// DeleteSetting deletes a setting by the name.
373func (s *Store) DeleteSetting(ctx context.Context, workspace string, name storepb.SettingName) error {
374 q := qb.Q().Space("DELETE FROM setting WHERE name = ? AND workspace = ?", name.String(), workspace)
375 query, args, err := q.ToSQL()
376 if err != nil {
377 return errors.Wrapf(err, "failed to build sql")
378 }
379
380 if _, err := s.GetDB().ExecContext(ctx, query, args...); err != nil {
381 return err
382 }
383
384 s.settingCache.Remove(getSettingCacheKey(workspace, name))
385 return nil
386}

Callers

nothing calls this directly

Calls 6

GetDBMethod · 0.95
QFunction · 0.92
getSettingCacheKeyFunction · 0.85
SpaceMethod · 0.80
ToSQLMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected