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

Method analyzeDeleteStatement

cmd/gosqlx/cmd/sql_analyzer.go:217–224  ·  view source on GitHub ↗

analyzeDeleteStatement analyzes DELETE statements

(stmt *ast.DeleteStatement)

Source from the content-addressed store, hash-verified

215
216// analyzeDeleteStatement analyzes DELETE statements
217func (a *SQLAnalyzer) analyzeDeleteStatement(stmt *ast.DeleteStatement) {
218 // Check for DELETE without WHERE clause
219 if stmt.Where == nil {
220 a.addSecurityIssue("DELETE_WITHOUT_WHERE", "CRITICAL",
221 "DELETE without WHERE clause will remove all rows from table",
222 "Always include WHERE clause in DELETE statements")
223 }
224}
225
226// analyzeJoinClause analyzes JOIN operations
227func (a *SQLAnalyzer) analyzeJoinClause(join *ast.JoinClause) {

Callers 1

VisitMethod · 0.95

Calls 1

addSecurityIssueMethod · 0.95

Tested by

no test coverage detected