(identifier: string)
| 121 | } |
| 122 | |
| 123 | function sanitizeSingleIdentifier(identifier: string): string { |
| 124 | const cleaned = identifier.replace(/"/g, '') |
| 125 | |
| 126 | if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(cleaned)) { |
| 127 | throw new Error( |
| 128 | `Invalid identifier: ${identifier}. Identifiers must start with a letter or underscore and contain only letters, numbers, and underscores.` |
| 129 | ) |
| 130 | } |
| 131 | |
| 132 | return `"${cleaned}"` |
| 133 | } |
| 134 | |
| 135 | export async function executeInsert( |
| 136 | sql: any, |
no test coverage detected