Skip to content

Instantly share code, notes, and snippets.

@charmygarg
Created February 27, 2019 04:49
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 charmygarg/12da81248d97eb5ab279beff9ad21864 to your computer and use it in GitHub Desktop.
Save charmygarg/12da81248d97eb5ab279beff9ad21864 to your computer and use it in GitHub Desktop.
def processUserAdded(addEvent: AddEvent): Future[Done] = {
session.withConnection { connection =>
val statement = connection.prepareStatement("INSERT INTO user (orgId, email, name) VALUES (?, ?, ?)")
statement.setInt(1, addEvent.user.orgId)
statement.setString(2, addEvent.user.email)
statement.setString(3, addEvent.user.name)
statement.execute()
}.map(_ => Done)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment