I am evaluating using Slick and Akka Streams with Oracle. The issue I am having is getting code gen to work.
scalaVersion := "2.11.6"
libraryDependencies ++= Seq("com.typesafe.slick" %% "slick" % "3.0.0",
"com.typesafe.slick" %% "slick-extensions" % "3.0.0",
"com.typesafe.akka" %% "akka-stream-experimental" % "1.0-M5",
"com.typesafe.slick" %% "slick-codegen" % "3.0.0",
"ch.qos.logback" % "logback-classic" % "1.1.2",
"org.slf4j" % "slf4j-api" % "1.7.7",
"ojdbc" % "ojdbc" % "14",
"com.zaxxer" % "HikariCP-java6" % "2.3.5"
)
The above are the dependencies, When running the below code
object SlickCodeGen extends App {
override def main(args : Array[String]) = {
val db = Database.forConfig("app.db.default")
val tables: dbio.DBIO[Seq[MTable]] = OracleDriver.defaultTables
val myTables: dbio.DBIO[Seq[MTable]] = tables.map {
(x : Seq[MTable]) => x.filter { (y : MTable) =>
y.name.name == "TLSN"// && y.tableType == "TABLE"
}
}
val modelAction = OracleDriver.createModel(Some(myTables))
val modelFuture = db.run(modelAction)
val outputFolder = "src/main/scala"
val codegenFuture = modelFuture.map(model =>
new SourceCodeGenerator(model) )
codegenFuture.onSuccess {
case codegen =>
codegen.writeToFile("com.typesafe.slick.driver.oracle.OracleDriver", outputFolder, "com.db.rpl.transformer.generated",
"Tables", "Tables.scala" )
}
Await.result(codegenFuture, 300 minutes)
// val exportSlickDriver = "slick.driver.MySQLDriver"
}
}
The debug logs show that it has a model (i.e. "Model(List(Table(QualifiedName(DSRC...." is printed in the log). However, there is nothing written out. There is no file at all. I had a previous issue where there was empty data but figured out that issue. I have tried chancing the outputFolder to absolute path, made sure the path exists, etc. It just seems to die but the error code is 0 upon exiting. Any help is much appreciated.
Thanks,
Ryan