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

Function isExplainAnalyze

backend/plugin/parser/pg/query_antlr.go:70–82  ·  view source on GitHub ↗

isExplainAnalyze checks if an ExplainStmt has the ANALYZE option.

(n *ast.ExplainStmt)

Source from the content-addressed store, hash-verified

68
69// isExplainAnalyze checks if an ExplainStmt has the ANALYZE option.
70func isExplainAnalyze(n *ast.ExplainStmt) bool {
71 if n.Options == nil {
72 return false
73 }
74 for _, item := range n.Options.Items {
75 if de, ok := item.(*ast.DefElem); ok {
76 if strings.EqualFold(de.Defname, "analyze") {
77 return true
78 }
79 }
80 }
81 return false
82}
83
84// isWriteSelect reports whether a SelectStmt actually writes — and so must not take
85// the read-only editor path. A SELECT writes if it has an INTO target (SELECT ...

Callers 1

validateQueryANTLRFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected