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

Function isReadOnlySelect

backend/plugin/parser/tsql/query.go:40–46  ·  view source on GitHub ↗

isReadOnlySelect returns true for SELECT statements without an INTO target. Non-SELECT nodes and SELECT ... INTO are rejected — INTO materialises a new table which is a DDL-like side effect.

(node ast.Node)

Source from the content-addressed store, hash-verified

38// Non-SELECT nodes and SELECT ... INTO are rejected — INTO materialises a new
39// table which is a DDL-like side effect.
40func isReadOnlySelect(node ast.Node) bool {
41 sel, ok := node.(*ast.SelectStmt)
42 if !ok {
43 return false
44 }
45 return !HasSelectInto(sel)
46}
47
48// HasSelectInto reports whether sel (or any branch of its set operations)
49// carries an INTO clause.

Callers 1

ValidateSQLForEditorFunction · 0.85

Calls 1

HasSelectIntoFunction · 0.85

Tested by

no test coverage detected