You mean codegen? It's not that different in 3. Try it out and if you get stuck on a compiler error post back here.
--
---
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/CAHQS_exCwX%2BkggRWw-c%2BvqC%2B1Yg1bvutVzQ7sxekgOyyc%3DyNmg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
import sbt._
import Keys._
object ChebiBuild extends Build {
lazy val chebiDB = project
.in(file("chebiDB")).settings(
name := "chebi database API",
version := "0.1.0",
scalaVersion := "2.11.6",
libraryDependencies ++= Seq(
"com.typesafe.slick" %% "slick" % "3.0.0-RC3",
"com.typesafe.slick" %% "slick-codegen" % "3.0.0-RC3",
"org.slf4j" % "slf4j-nop" % "1.6.4",
"org.postgresql" % "postgresql" % "9.3-1100-jdbc4",
"com.h2database" % "h2" % "1.3.170",
"org.xerial" % "sqlite-jdbc" % "3.7.2"),
sourceGenerators in Compile <+= slickCodeGenTask
)
lazy val slick = TaskKey[Seq[File]]("gen-tables")
lazy val slickCodeGenTask = (sourceManaged, dependencyClasspath in Compile, runner in Compile, streams) map { (dir, cp, r, s) =>
val outputDir = (dir / "slick") // place generated files in sbt's managed sources folder
val url = "jdbc:postgresql://localhost/chebi" // connection info for a pre-populated throw-away, in-memory db for this demo, which is freshly initialized on every run
val jdbcDriver = "org.postgresql.Driver"
val slickDriver = "slick.driver.PostgresDriver"
val pkg = "uk.co.ebi.chebi"
toError(r.run("slick.codegen.SourceCodeGenerator", cp.files, Array(
slickDriver, jdbcDriver, url, outputDir.getPath, pkg, "chebi", "chebi"), s.log))
val fname = outputDir.getPath + "/uk/co/ebi/chebi/Tables.scala"
unmanagedSourceDirectories in Compile += outputDir
Seq(file(fname))
}
}
To view this discussion on the web visit https://groups.google.com/d/msgid/scalaquery/CANpg8PCONoiq8TzdP0eVrURm9bf%3D__UKvCBVrgRWWiePQjdx%2Bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.