3 ms·
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 findByI
by runT1ME 13y 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
- terhechte 13y agoCertainly 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.