(result: unknown)
| 29 | export type WorkflowDeploymentVersion = InferSelectModel<typeof workflowDeploymentVersion> |
| 30 | |
| 31 | function hasReturnedRows(result: unknown): boolean { |
| 32 | if (Array.isArray(result)) return result.length > 0 |
| 33 | |
| 34 | if (result && typeof result === 'object') { |
| 35 | const rows = 'rows' in result ? result.rows : undefined |
| 36 | if (Array.isArray(rows)) return rows.length > 0 |
| 37 | } |
| 38 | |
| 39 | return Boolean(result) |
| 40 | } |
| 41 | |
| 42 | async function lockWorkflowForUpdate(tx: DbOrTx, workflowId: string): Promise<boolean> { |
| 43 | const query = tx.select({ id: workflow.id }).from(workflow).where(eq(workflow.id, workflowId)) |
no outgoing calls
no test coverage detected