I currently have the following and where each individual record gets executed one at a time.
typedRecords.foreach(publishToDatabase(_)) def publishToDatabase