joinIterateJoinedRecords<JK extends SdbKey, JV extends SdbValue> method
Future<void>
joinIterateJoinedRecords<JK extends SdbKey, JV extends SdbValue>(
- SdbClient client, {
- required SdbJoinTarget<
JK, JV> target, - SdbTransactionMode? mode,
- SdbFindOptions<
SK> ? options, - SdbJoinFindOptions? joinOptions,
- required SdbJoinRecordHandler<
JK, JV> onRecord,
Iterate the records this source references, without reading the source records.
The rows matching nothing are dropped (the iteration is always inner, there is no record to hand out otherwise), so the records handed out are never null. A source record matching several records gives one record per match.
Pass distinct: true in a SdbJoinFindOptions to hand out the records
of each join key once, which is how you read the records actually
referenced by this source.
Implementation
Future<void> joinIterateJoinedRecords<JK extends SdbKey, JV extends SdbValue>(
SdbClient client, {
required SdbJoinTarget<JK, JV> target,
SdbTransactionMode? mode,
SdbFindOptions<SK>? options,
SdbJoinFindOptions? joinOptions,
required SdbJoinRecordHandler<JK, JV> onRecord,
}) => _joinRun<JK, JV>(
client,
target: target,
mode: mode,
options: options,
joinOptions: joinOptions,
emit: SdbJoinEmit.joinedRecords,
forceInner: true,
onEmit: (row) {
var joinedRecord = row.joinedRecord;
// Always inner, so there is one; never crash if an implementation
// hands out a row without it.
return joinedRecord == null ? true : onRecord(joinedRecord);
},
);