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

Function IsReadOnlyStatement

backend/plugin/parser/trino/query_type.go:91–96  ·  view source on GitHub ↗

IsReadOnlyStatement reports whether the given omni AST node is a read-only Trino statement (SELECT family, EXPLAIN, SHOW/DESCRIBE, session-state).

(node ast.Node)

Source from the content-addressed store, hash-verified

89// IsReadOnlyStatement reports whether the given omni AST node is a read-only
90// Trino statement (SELECT family, EXPLAIN, SHOW/DESCRIBE, session-state).
91func 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.
99func IsDataChangingStatement(node ast.Node) bool {

Callers 2

TestTrinoParserFunction · 0.85

Calls 1

getQueryTypeFunction · 0.70

Tested by 2

TestTrinoParserFunction · 0.68