(params: {
search?: string
workflowName?: string
folderName?: string
executionId?: string
})
| 165 | } |
| 166 | |
| 167 | function buildSearchConditions(params: { |
| 168 | search?: string |
| 169 | workflowName?: string |
| 170 | folderName?: string |
| 171 | executionId?: string |
| 172 | }): SQL[] { |
| 173 | const conditions: SQL[] = [] |
| 174 | |
| 175 | if (params.search) { |
| 176 | const searchTerm = `%${params.search}%` |
| 177 | conditions.push(sql`${workflowExecutionLogs.executionId} ILIKE ${searchTerm}`) |
| 178 | } |
| 179 | |
| 180 | if (params.workflowName) { |
| 181 | const nameTerm = `%${params.workflowName}%` |
| 182 | conditions.push(sql`${workflow.name} ILIKE ${nameTerm}`) |
| 183 | } |
| 184 | |
| 185 | if (params.folderName) { |
| 186 | const folderTerm = `%${params.folderName}%` |
| 187 | conditions.push(sql`${workflow.name} ILIKE ${folderTerm}`) |
| 188 | } |
| 189 | |
| 190 | if (params.executionId) { |
| 191 | conditions.push(eq(workflowExecutionLogs.executionId, params.executionId)) |
| 192 | } |
| 193 | |
| 194 | return conditions |
| 195 | } |
| 196 | |
| 197 | function buildCostCondition(operator: ComparisonOperator, value: number): SQL { |
| 198 | // Indexed projection of the usage_log ledger (dollars); no live aggregation. |
no test coverage detected