The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import * as Effect from "effect/Effect"; |
| 2 | import * as SqlClient from "effect/sql/SqlClient"; |
| 3 | |
| 4 | // Thread projections may hold a boolean settledOverride, which the thread schema rejects. |
| 5 | export default Effect.gen(function* () { |
| 6 | const sql = yield* SqlClient.SqlClient; |
| 7 | yield* sql` |
| 8 | UPDATE orchestration_v2_projection_threads |
| 9 | SET payload_json = json_set(payload_json, '$.settledOverride', |
| 10 | IIF(json_type(payload_json, '$.settledOverride') = 'true', 'settled', NULL)) |
| 11 | WHERE json_valid(payload_json) |
| 12 | AND json_type(payload_json, '$.settledOverride') IN ('true', 'false') |
| 13 | `; |
| 14 | }); |