I'm new to scala and slick. I have to write an update statement to update a value in properties table.
def updateValue(key: String, value: String) = Try(Tables.Properties.filter(_.key === key).map(j => j.value).update(Option(value)) ) match {
case success => println("Record sucessfully updated")
case failure => println("An error occurred")
}
The above method is executing without any error but when I check in the table, it is not updating any value in the table. Is there anything else I have to add here?
db.run
. Hoping that you can find it useful have a look at this tutorial I wrote a while ago: pedrorijo.com/blog/play-slick with the code example at github.com/pedrorijo91/play-slick3-steps/tree/step3 – pedrorijo91