Skip to content

Instantly share code, notes, and snippets.

@wshino
Created October 2, 2013 08:42
Show Gist options
  • Save wshino/6790797 to your computer and use it in GitHub Desktop.
Save wshino/6790797 to your computer and use it in GitHub Desktop.
def create(createdAt: DateTime = DateTime.now)(
implicit session: AsyncDBSession = AsyncDB.sharedSession, cxt: EC = ECGlobal): Future[Log] = {
for {
id <- withSQL {
insert.into(Log).namedValues(column.createdAt -> createdAt)
}.updateAndReturnGeneratedKey.future()
} yield Log(id = id, createdAt = createdAt)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment