Skip to content

Instantly share code, notes, and snippets.

@vichu
Created December 23, 2018 00:06
Show Gist options
  • Save vichu/f5b41332034210f7182cc57b59e749fa to your computer and use it in GitHub Desktop.
Save vichu/f5b41332034210f7182cc57b59e749fa to your computer and use it in GitHub Desktop.
val userPair = for{
uuid <- databaseService.createUser(UUID.nameUUIDFromBytes("Sumanth".getBytes), "Sumanth", "Kumar", "sumanth@indywiz.com")
userByFirstName <- databaseService.selectUserByFirstName("Sumanth")
userById <- databaseService.selectUserById(uuid.get)
} yield (userById, userByFirstName)
val res = userPair.map {
case (userById, userByFirstName) =>
logger.info(s"User by Id : ${userById.get}")
logger.info(s"User by first name: ${userByFirstName.get}")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment