IsReadOnlyStatement reports whether the given omni AST node is a read-only Trino statement (SELECT family, EXPLAIN, SHOW/DESCRIBE, session-state).
(node ast.Node)
| 89 | // IsReadOnlyStatement reports whether the given omni AST node is a read-only |
| 90 | // Trino statement (SELECT family, EXPLAIN, SHOW/DESCRIBE, session-state). |
| 91 | func IsReadOnlyStatement(node ast.Node) bool { |
| 92 | queryType, _ := getQueryType(node) |
| 93 | return queryType == base.Select || |
| 94 | queryType == base.Explain || |
| 95 | queryType == base.SelectInfoSchema |
| 96 | } |
| 97 | |
| 98 | // IsDataChangingStatement reports whether the node is a DML statement. |
| 99 | func IsDataChangingStatement(node ast.Node) bool { |