runjorel
07/07/2019, 6:15 AMUPDATE Users SET active=false WHERE id IN (SELECT user_id FROM deactivated)
It seems the only option I have is inList
but I am afraid if I call map{..}/toList()
on my subquery it would materialize those results.tapac
07/08/2019, 7:16 PMUsers.innerjoin(Deactivated).update {
it[Users.active] = false
}
val subquery = wrapAsExpression<List<EntityId<Int>>(Deactivated.slice(Deactivated.userId).selectAll())
Users.update( where = {
Users.id inList subquery}) {
it[Users.active] = false
}
runjorel
07/08/2019, 9:13 PM