Hacker News new | ask | show | jobs
by hu3 651 days ago
Interesting, it throws an error if result rows don't match expected quantity?
1 comments

Yes, and together with .in_transaction(cb) wrapper it also rolls everything back. Sadly SQL itself doesn't have something like ASSERT ROWCOUNT <expr>, cause it's such an obvious check, especially in destructive ops. LIMIT exists, but it is silent and quirky with non-SELECTs.