SQL vs Ecto optimization/translation help

Will keep that in mind @brightball, though I have some reluctance/resistance to splitting actual application logic across code and database stored functions… I know it can be efficient, and I like Ecto’s philosophy of trusting the database for constraints, which arguably verges into application logic in some cases, but constraints are pretty simple compared to stored procedures.. not ruling it out, but I don’t think the increase in complexity is justified at this point.