This is very very frustrating. I tried to pick up Slick for a while, and the obstacles just continue. Slick’s concept is really awesome, but it’s very difficult to learn, and unlike Scala, it doesn’t have a “beginner”, “intermediate” or “advanced” style, where people at all stages can easily use it.
I am using Play-Slick (Slick 2.0.0) https://github.com/freekh/play-slick , following the example of a multiple DB example: https://github.com/freekh/play-slick/tree/master/ samples / play-slick-cake-sample / app
For some reason, firstly, it ddldoes not apply TableQuery, unlike the claim in the document: "The ddl TableQuery method creates DDL." This shows through scaladoc: http://slick.typesafe.com/doc/2.0.0/api/#scala.slick.lifted.TableQuery There is no method ddl.
Secondly, mine slick.lifted.Querycannot generate a method delete. It works great with list, but not with delete.
val S3Files = TableQuery[S3Files]
S3Files.where(_.url === url).delete
This will not work ... then I tried:
val query = (for(s <- S3Files if s.url === url) yield s)
query.list
query.delete
val query2 = (for(s <- S3Files if s.url === url))
query2.delete
Well ... since Slick uses a very sophisticated (at least for beginners) implicit type conversion system, I really don't know what went wrong.
source
share