val affectedRowsCount = query.delete val invoker = query.deleteInvoker
val statement = query.deleteStatement
val query = coffees.filter(_.supID === 15)
val action = query.delete
val affectedRowsCount: Future[Int] = db.run(action) val sql = action.statements.head
/** Select all elements except the first `num` ones. */
def drop(num: Int): Query[E, U, C] = drop(num.toLong)
val q = MarketplacesQuery.filter(_.id > 0l)
q.drop(10)
--
---
You received this message because you are subscribed to the Google Groups "Slick / ScalaQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalaquery+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalaquery/7c897359-fcdb-43ee-aff3-47d8149804b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
"returns a list of marketplaces" in new WithApplication() {
//given
Database.forURL(url = connectionUrl, driver = mysqlDriver) withSession { implicit session =>
var deleteall = MarketplacesQuery.filter(_.id > 0l).delete // does not work
MarketplacesQuery.map(m => (m.name, m.email, m.contact))
.insert(("some recording label", "some email", "some contact")) //works
}
//when
val actualResultFuture: Future[SimpleResult] = controllers.MarketplaceController.list()(FakeRequest())
//then
actualResultFuture.map(asyncResult => {
asyncResult.header.status must equalTo(OK)
asyncResult.header.headers("Content-Type") must equalTo("application/json")
})
}
import play.Project._
name := "zyx-backend"
version := "1.0"
scalaVersion := "2.10.4"
playScalaSettings
resolvers += "Artima Maven Repository" at "http://repo.artima.com/releases"
libraryDependencies ++= Seq(
jdbc,
"com.google.zxing" % "core" % "2.0",
"mysql" % "mysql-connector-java" % "5.1.36",
"com.typesafe.slick" %% "slick" % "2.1.0",
"com.typesafe.play" %% "play-slick" % "0.6.1",
"org.slf4j" % "slf4j-nop" % "1.6.4",
"com.cloudphysics" % "jerkson_2.10" % "0.6.3",
"org.scalactic" %% "scalactic" % "3.0.0",
"org.scalatest" %% "scalatest" % "3.0.0" % "test"
)
import play.api.db.slick.Config.driver.simple._
When I ctrl+clicked, It navigates to DeleteInvoker, which is actually in package scala.slick.driver
class DeleteInvoker(protected val tree: Node, param: Any) {
protected[this] val ResultSetMapping(_, CompiledStatement(_, sres: SQLBuilder.Result, _), _) = tree
def deleteStatement = sres.sql
def delete(implicit session: Backend#Session): Int = session.withPreparedStatement(deleteStatement) { st =>
sres.setter(st, 1, param)
st.executeUpdate
}
def deleteInvoker: this.type = this
}I dont know how's play.api.db.slick.Config.driver.simple._ mapped to package scala.slick.driver