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

Function NewStatusBySQLReviewRuleLevel

backend/plugin/advisor/advisor.go:26–35  ·  view source on GitHub ↗

NewStatusBySQLReviewRuleLevel returns status by SQLReviewRuleLevel.

(level storepb.SQLReviewRule_Level)

Source from the content-addressed store, hash-verified

24
25// NewStatusBySQLReviewRuleLevel returns status by SQLReviewRuleLevel.
26func NewStatusBySQLReviewRuleLevel(level storepb.SQLReviewRule_Level) (storepb.Advice_Status, error) {
27 switch level {
28 case storepb.SQLReviewRule_ERROR:
29 return storepb.Advice_ERROR, nil
30 case storepb.SQLReviewRule_WARNING:
31 return storepb.Advice_WARNING, nil
32 default:
33 return storepb.Advice_STATUS_UNSPECIFIED, errors.Errorf("unexpected rule level type: %s", level)
34 }
35}
36
37// Context is the context for advisor.
38type Context struct {

Callers 15

CheckMethod · 0.92
CheckMethod · 0.92
CheckMethod · 0.92
CheckMethod · 0.92
CheckMethod · 0.92
CheckMethod · 0.92
CheckMethod · 0.92
CheckMethod · 0.92
CheckMethod · 0.92
CheckMethod · 0.92
CheckMethod · 0.92
CheckMethod · 0.92

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected