MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / stmtTypeName

Function stmtTypeName

pkg/transform/transform.go:165–178  ·  view source on GitHub ↗

stmtTypeName returns a human-readable name for a statement type.

(stmt ast.Statement)

Source from the content-addressed store, hash-verified

163
164// stmtTypeName returns a human-readable name for a statement type.
165func stmtTypeName(stmt ast.Statement) string {
166 switch stmt.(type) {
167 case *ast.SelectStatement:
168 return "SELECT"
169 case *ast.UpdateStatement:
170 return "UPDATE"
171 case *ast.DeleteStatement:
172 return "DELETE"
173 case *ast.InsertStatement:
174 return "INSERT"
175 default:
176 return fmt.Sprintf("%T", stmt)
177 }
178}
179
180// ParseSQL parses a SQL string into a full AST containing all statements. This is
181// a convenience wrapper around the tokenizer and parser pipeline that handles

Callers 8

getWhereFunction · 0.70
AddSetClauseFunction · 0.70
RemoveSetClauseFunction · 0.70
ReplaceSetClauseFunction · 0.70
getReturningFunction · 0.70
ReplaceTableFunction · 0.70
AddTableAliasFunction · 0.70
getSelectFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected