Rewrote the sql to implement case_ support added to esqueleto