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

Function IsNonTransactionStatement

backend/plugin/db/pg/pg.go:736–747  ·  view source on GitHub ↗
(stmt string)

Source from the content-addressed store, hash-verified

734}
735
736func IsNonTransactionStatement(stmt string) bool {
737 if len(dropDatabaseReg.FindString(stmt)) > 0 {
738 return true
739 }
740 if len(createIndexReg.FindString(stmt)) > 0 {
741 return true
742 }
743 if len(dropIndexReg.FindString(stmt)) > 0 {
744 return true
745 }
746 return len(vacuumReg.FindString(stmt)) > 0
747}
748
749func isSuperuserStatement(stmt string) bool {
750 upperCaseStmt := strings.ToUpper(strings.TrimLeftFunc(stmt, unicode.IsSpace))

Callers 2

OnStatementMethod · 0.92
ExecuteMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected