isExplainAnalyze checks if an ExplainStmt has the ANALYZE option.
(n *ast.ExplainStmt)
| 68 | |
| 69 | // isExplainAnalyze checks if an ExplainStmt has the ANALYZE option. |
| 70 | func 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 ... |
no outgoing calls
no test coverage detected