* Quote SQLite identifiers to handle column names correctly. * SQLite uses double quotes for identifiers.
(name: string)
| 71 | * SQLite uses double quotes for identifiers. |
| 72 | */ |
| 73 | function quoteIdentifier(name: string): string { |
| 74 | // Escape any double quotes in the name by doubling them |
| 75 | const escaped = name.replace(/"/g, `""`) |
| 76 | return `"${escaped}"` |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Compiles a BasicExpression to a SQL string, mutating the params array. |