(table: string, where: string)
| 104 | } |
| 105 | |
| 106 | export function buildDeleteQuery(table: string, where: string) { |
| 107 | validateWhereClause(where) |
| 108 | |
| 109 | const sanitizedTable = sanitizeIdentifier(table) |
| 110 | const query = `DELETE FROM ${sanitizedTable} WHERE ${where}` |
| 111 | |
| 112 | return { query, values: [] } |
| 113 | } |
| 114 | |
| 115 | /** |
| 116 | * Validates a WHERE clause to prevent SQL injection attacks |
no test coverage detected