MCPcopy Create free account
hub / github.com/bytebase/bytebase / Diagnose

Function Diagnose

backend/plugin/parser/tidb/diagnose.go:15–28  ·  view source on GitHub ↗
(_ context.Context, _ base.DiagnoseContext, statement string)

Source from the content-addressed store, hash-verified

13}
14
15func Diagnose(_ context.Context, _ base.DiagnoseContext, statement string) ([]base.Diagnostic, error) {
16 diagnostics := make([]base.Diagnostic, 0)
17 _, err := ParseTiDB(statement, "", "")
18 var syntaxError *base.SyntaxError
19 if err != nil {
20 if errors.As(err, &syntaxError) {
21 diagnostics = append(diagnostics, base.ConvertSyntaxErrorToDiagnostic(syntaxError, statement))
22 } else {
23 return nil, err
24 }
25 }
26
27 return diagnostics, nil
28}

Callers

nothing calls this directly

Calls 2

ParseTiDBFunction · 0.85

Tested by

no test coverage detected