Replies: 4 comments 1 reply
|
My current workaround is this but it would be cool to be able to do it via parameters: Future<Set<JobSchedule>> Function() loadJobSchedulesSqlCapsule(
CapsuleHandle use,
) {
final executeDbQuery = use(executeDbQueryCapsule);
final glovoShiftSlots = use(glovoShiftSlotsCapsule);
final log = use(logCapsule)('Load job schedules (SQL)');
return () {
final ids = glovoShiftSlots
.getAll()
.map((glovoShiftSlot) => glovoShiftSlot.id)
.map((id) => '\'$id\'')
.reduceSecure((value, element) => '$value, $element', '');
log.info('Ids: $ids');
return executeDbQuery(
'SELECT * FROM $_schema.$_table WHERE glovo_shift_slot_id IN ($ids)',
).then((result) => result.map(JobSchedule.fromResultRow).toSet());
};
} |
|
@busslina: I think the However, even if this works, we have a very limited story for array types and some other base types, and should probably introduce more special objects that are handled automatically. |
|
This is an LLM reply, but I think it has merits:
|
|
Closing as I don't see any actionable item here. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'm trying multiple ways, none worked:
All reactions