(value: SqlParam)
| 126 | |
| 127 | // Where methods |
| 128 | private escapeValue(value: SqlParam): string { |
| 129 | if (value === null) { |
| 130 | return 'NULL'; |
| 131 | } |
| 132 | if (value instanceof Expression) { |
| 133 | return `(${value.toString()})`; |
| 134 | } |
| 135 | if (Array.isArray(value)) { |
| 136 | return `(${value.map((v) => this.escapeValue(v)).join(', ')})`; |
| 137 | } |
| 138 | |
| 139 | if ( |
| 140 | (typeof value === 'string' && this._dateValueRegex.test(value)) || |
| 141 | value instanceof Date |
| 142 | ) { |
| 143 | return this.escapeDate(value); |
| 144 | } |
| 145 | |
| 146 | return sqlstring.escape(value); |
| 147 | } |
| 148 | |
| 149 | where(column: string, operator: Operator, value?: SqlParam): this { |
| 150 | if (this._skipNext) { |
no test coverage detected