(op: string, userIds: readonly string[])
| 104 | }); |
| 105 | |
| 106 | const userRows = (op: string, userIds: readonly string[]) => |
| 107 | Effect.gen(function* () { |
| 108 | const users = new Map<string, (typeof UserRow)["Type"]>(); |
| 109 | for (let start = 0; start < userIds.length; start += IN_CHUNK) { |
| 110 | const ids = userIds.slice(start, start + IN_CHUNK); |
| 111 | const page = yield* read(op, () => |
| 112 | adapter.findMany({ |
| 113 | model: "user", |
| 114 | where: [{ field: "id", operator: "in", value: [...ids] }], |
| 115 | limit: ids.length, |
| 116 | }), |
| 117 | ).pipe(Effect.flatMap(decodeUserRows), Effect.mapError(undecodable(op))); |
| 118 | for (const user of page) users.set(user.id, user); |
| 119 | } |
| 120 | return users; |
| 121 | }); |
| 122 | |
| 123 | // Every read: the member rows matching `where`, joined to their users. A |
| 124 | // member whose user row is gone is not reported — there is no principal |
no test coverage detected