| 1145 | } as const satisfies Record<Reply.Reply<any>["_tag"], number | null> |
| 1146 | |
| 1147 | const replyFromRow = (row: ReplyRow): Reply.Encoded => |
| 1148 | row.kind !== null && Number(row.kind) === replyKind.WithExit ? |
| 1149 | { |
| 1150 | _tag: "WithExit", |
| 1151 | id: String(row.id), |
| 1152 | requestId: String(row.request_id), |
| 1153 | exit: JSON.parse(row.payload) |
| 1154 | } : |
| 1155 | { |
| 1156 | _tag: "Chunk", |
| 1157 | id: String(row.id), |
| 1158 | requestId: String(row.request_id), |
| 1159 | values: JSON.parse(row.payload), |
| 1160 | sequence: Number(row.sequence!) |
| 1161 | } |
| 1162 | |
| 1163 | type MessageRow = { |
| 1164 | readonly id: string | bigint |