Last active
December 15, 2015 20:00
-
-
Save blast-hardcheese/5315702 to your computer and use it in GitHub Desktop.
Trying to figure out how to write delete queries in ScalaQuery/SLICK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! Internal server error, for request [GET /tasks/1/delete?] -> | |
sbt.PlayExceptions$CompilationException: Compilation error [could not find implicit value for parameter om: org.scalaquery.ql.OptionMapper2[Int,Int,Boolean,Int,Long,R]] | |
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12$$anonfun$apply$13.apply(PlayReloader.scala:236) ~[na:na] | |
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12$$anonfun$apply$13.apply(PlayReloader.scala:236) ~[na:na] | |
at scala.Option.map(Option.scala:133) ~[scala-library.jar:0.11.3] | |
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12.apply(PlayReloader.scala:236) ~[na:na] | |
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12.apply(PlayReloader.scala:233) ~[na:na] | |
at scala.Option.map(Option.scala:133) ~[scala-library.jar:0.11.3] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object TaskT extends BasicTable[(Int, String)]("task") { | |
def id = column[Int]("id") | |
def label = column[String]("label") | |
def * = id ~ label | |
} | |
object TaskSQ { | |
lazy val database = Database.forDataSource(DB.getDataSource()) | |
def delete(id: Long) { database withSession { | |
(for(t <- TaskT if(t.id is id)) yield t).delete | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment