I want to directly update the concerned lines. How do I do that without having to select the items and updating them one by one in Drift?
My current code:
final concernedSongs = await (select(playlistSongs)
..where((tbl) => tbl.order.isBetweenValues(low + 1, high)))
.get(); // should just update and decrement the values without reiterating over them
concernedSongs.forEach((song) {
reOrder(song.id, song.order - 1);
});
2
Answers
This is not possible with only dart code at the moment.
You should look into using a customStatement. Something like:
You can use custom queries, Reference To Docs
this query may help you to get some idea,