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

Method analyzeUpdateStatement

cmd/gosqlx/cmd/sql_analyzer.go:207–214  ·  view source on GitHub ↗

analyzeUpdateStatement analyzes UPDATE statements

(stmt *ast.UpdateStatement)

Source from the content-addressed store, hash-verified

205
206// analyzeUpdateStatement analyzes UPDATE statements
207func (a *SQLAnalyzer) analyzeUpdateStatement(stmt *ast.UpdateStatement) {
208 // Check for UPDATE without WHERE clause
209 if stmt.Where == nil {
210 a.addSecurityIssue("UPDATE_WITHOUT_WHERE", "CRITICAL",
211 "UPDATE without WHERE clause will modify all rows in table",
212 "Always include WHERE clause in UPDATE statements")
213 }
214}
215
216// analyzeDeleteStatement analyzes DELETE statements
217func (a *SQLAnalyzer) analyzeDeleteStatement(stmt *ast.DeleteStatement) {

Callers 1

VisitMethod · 0.95

Calls 1

addSecurityIssueMethod · 0.95

Tested by

no test coverage detected