Below is the code I use in inserting into the db however when the name of a group which is unique is entered I get a unique key violation in the logs
override def create(groups: GroupEntity): Future[GroupEntity] = db.run{groupsTableQuery returning groupsTableQuery += groups}
See Question&Answers more detail:os