Bridging the gap between SQL and Ruby