Skip to content
Discussion options

You must be logged in to vote

Hi @sillygoose, you can construct your when like this:

when: { old in
  Charge
    .where { $0.locationID.eq(old.locationID) }
    .exists()
}

This has the added benefit of being a little more efficient too. SQLite can just stop once it finds a row satisfying the condition rather than counting all rows that satisfy the condition.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sillygoose
Comment options

Answer selected by sillygoose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants