(query: knexlib.Knex.QueryBuilder, conditions: WhereEntry[])
| 132 | } |
| 133 | |
| 134 | function applyConditionToQuery(query: knexlib.Knex.QueryBuilder, conditions: WhereEntry[]): knexlib.Knex.QueryBuilder { |
| 135 | for (const clause of conditions) { |
| 136 | if (clause.useRawCast) { |
| 137 | // Use raw to cast the column to text for the comparison |
| 138 | query = query.whereRaw(`${clause.column}::text ${clause.operator} ?`, [clause.value]); |
| 139 | } else { |
| 140 | query = query.where(clause.column, clause.operator, clause.value); |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | return query; |
| 145 | } |
| 146 | |
| 147 | function getTransformedValue(targetColumn: Column, value: any, isNumericComparison: boolean) { |
| 148 | if (targetColumn.type === 'boolean') { |
no outgoing calls
no test coverage detected