(runId: string, organizationId?: string | null)
| 168 | } |
| 169 | |
| 170 | async getLastSequence(runId: string, organizationId?: string | null): Promise<number> { |
| 171 | const runFilter = this.buildRunFilter(runId, organizationId); |
| 172 | const [result] = await this.db |
| 173 | .select({ sequence: workflowTracesTable.sequence }) |
| 174 | .from(workflowTracesTable) |
| 175 | .where(runFilter) |
| 176 | .orderBy(desc(workflowTracesTable.sequence)) |
| 177 | .limit(1); |
| 178 | |
| 179 | return result?.sequence ?? 0; |
| 180 | } |
| 181 | |
| 182 | private mapToInsert(event: PersistedTraceEvent) { |
| 183 | return { |
no test coverage detected