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

Method GetSemanticTypesSetting

backend/store/setting.go:167–181  ·  view source on GitHub ↗

GetSemanticTypesSetting gets the semantic types setting.

(ctx context.Context, workspaceID string)

Source from the content-addressed store, hash-verified

165
166// GetSemanticTypesSetting gets the semantic types setting.
167func (s *Store) GetSemanticTypesSetting(ctx context.Context, workspaceID string) (*storepb.SemanticTypeSetting, error) {
168 setting, err := s.GetSetting(ctx, workspaceID, storepb.SettingName_SEMANTIC_TYPES)
169 if err != nil {
170 return nil, errors.Wrapf(err, "failed to get setting %v", storepb.SettingName_SEMANTIC_TYPES)
171 }
172 if setting == nil {
173 return &storepb.SemanticTypeSetting{}, nil
174 }
175
176 val, ok := setting.Value.(*storepb.SemanticTypeSetting)
177 if !ok {
178 return nil, errors.Errorf("invalid setting value type for %s", storepb.SettingName_SEMANTIC_TYPES)
179 }
180 return val, nil
181}
182
183// GetDataClassificationSetting gets the data classification setting.
184func (s *Store) GetDataClassificationSetting(ctx context.Context, workspaceID string) (*storepb.DataClassificationSetting, error) {

Callers 4

UpdateDatabaseCatalogMethod · 0.80
MaskResultsMethod · 0.80

Calls 2

GetSettingMethod · 0.95
ErrorfMethod · 0.80

Tested by

no test coverage detected