Replies: 2 comments
-
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());
};
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
@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. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
Beta Was this translation helpful? Give feedback.
All reactions