Skip to content

Instantly share code, notes, and snippets.

@adamw
Last active September 20, 2019 06:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamw/4536f0b6f910be323839e911eaa9905f to your computer and use it in GitHub Desktop.
Save adamw/4536f0b6f910be323839e911eaa9905f to your computer and use it in GitHub Desktop.
val insertEventQuery: ConnectionIO[Int] =
sql"INSERT INTO events(msg) VALUES('made a http call')".update.run
val result: IO[Int] = queryFromHttpCall
.map(countQuery => insertEventQuery >> countQuery)
.flatMap(_.transact(transactor))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment