Hacker News new | ask | show | jobs
by runT1ME 4625 days ago
This looks great. Seriously all of the answers you give seem simple and convenient ways of doing things.

You could reduce your first example to def findById(userId: Int)(implicit s: Session) = Users.filter(_.id === userId).firstOption

1 comments

Certainly true, but when you're just starting out, that kind of thinking may not be there yet. You need some time with Slick to understand this, and it is difficult to get into it because it lacks the simple facilities. I actually spend a lot of time searching for these simple facitilies until I realized that they're really not there yet.