I have two days trying to run a plain SQL query using Slick 3.1.1, I followed the Getting Started and Database Configuration guides.
The issue is that while the code compiles properly, it is ignoring my database parameters (the ones in the config are wrong), it prints this to StdOut (while it should throw an exception):
HikariCP pool database is starting.
List()
Here is my test code:
import slick.driver.PostgresDriver.api._
import scala.concurrent.ExecutionContext.Implicits.global
object app extends App {
doit
def doit {
val db = Database.forConfig("mydb")
val result = db.run( sql"SELECT NOW()".as[String] )
println(result)
}
}
Here is 'application.conf'
mydb = {
dataSourceClass = "org.postgresql.ds.PGSimpleDataSource"
properties = {
databaseName = "mydb"
user = "myuser"
password = "secret"
}
numThreads = 10
}
Here is 'build.sbt'
libraryDependencies ++= Seq(
"org.postgresql" % "postgresql" % "9.4.1208",
"mysql" % "mysql-connector-java" % "5.1.35",
"com.typesafe.slick" %% "slick" % "3.1.1",
"com.typesafe.slick" %% "slick-hikaricp" % "3.1.1",
"com.zaxxer" % "HikariCP" % "2.4.7"
)
Also, I have scala "2.11.8".