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

Function isExplainAnalyzeOmni

backend/plugin/parser/pg/query_type.go:124–136  ·  view source on GitHub ↗

isExplainAnalyzeOmni checks if an ExplainStmt has the ANALYZE option.

(n *ast.ExplainStmt)

Source from the content-addressed store, hash-verified

122
123// isExplainAnalyzeOmni checks if an ExplainStmt has the ANALYZE option.
124func isExplainAnalyzeOmni(n *ast.ExplainStmt) bool {
125 if n.Options == nil {
126 return false
127 }
128 for _, item := range n.Options.Items {
129 if de, ok := item.(*ast.DefElem); ok {
130 if strings.EqualFold(de.Defname, "analyze") {
131 return true
132 }
133 }
134 }
135 return false
136}
137
138// classifyExplainedQuery returns the QueryType for the query inside EXPLAIN ANALYZE.
139func classifyExplainedQuery(query ast.Node) base.QueryType {

Callers 1

classifyQueryTypeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected