I have a scala application which uses the Slick 3.x for the DB calls. Since all the Slick 3 calls are Async, it returns the Future[Option].
So I am trying to get the result from a DB call and use that data to do other things. i.e
My DB class has the following code:
// Method to get the User record by username
def getUserByUsername(username: String): Future[Option[User]] = {
val query = userData.filter(user => user.username === username)
val action = query.result.headOption
db.run(action)
}
In my controller, I call the above method and i wanted to use the returned 'User' data for other calls. Can someone please help me how do I do this?