What's the general consensus of what logic should remain in the DB? There are a few places I write SQL and call it from a host language and think "this feels like it should all be in SQL, but it'd be much more verbose". Just interested in what anyone here thinks.