play slick 2.5

79 views
Skip to first unread message

prasad mokkapati

unread,
May 5, 2016, 6:57:32 PM5/5/16
to Slick / ScalaQuery
Hi

I started using Play Slick 2.5 and using the examples given in the documentation, but keep getting this error.

type current is not a member of object play.api.Play

[error]   val dbConfig = DatabaseConfigProvider.get[JdbcProfile][Play.current]


I am including the following imports.

import play.api._

import play.api.db.slick._

import play.api.Play.current

import play.api.db.slick.DatabaseConfigProvider

import scala.concurrent.ExecutionContext.Implicits.global

import slick.driver.JdbcProfile

import slick.jdbc._


Does anybody know what could be the problem.

BTW. This was working before with PlaySlick plugin 1.1.1. I used 2.0.0 and I get this error. I went back t0 1.1.1 and still get this error.



Mark Lewis

unread,
May 6, 2016, 9:01:55 AM5/6/16
to Slick / ScalaQuery
My experience is that you really need to use the DI approach. I know that the documentation page still shows that this should work, but it hasn't for me. Thankfully, that page also shows the DI approach, and the change is fairly minimal.

prasad mokkapati

unread,
May 6, 2016, 2:10:14 PM5/6/16
to Slick / ScalaQuery
Thanks Mark. I will give it a shot and see if that works.

Roy Phillips

unread,
May 9, 2016, 4:16:46 PM5/9/16
to Slick / ScalaQuery
 
val dbConfig = DatabaseConfigProvider.get[JdbcProfile][Play.current]
 Looks like a typo, 'Play.current' should be in parentheses, not square brackets:
val dbConfig = DatabaseConfigProvider.get[JdbcProfile](Play.current)

prasad mokkapati

unread,
May 9, 2016, 7:26:17 PM5/9/16
to scala...@googlegroups.com
Hi,

Thanks for catch, didn't see it. Guess I just screwed up :(

--

---
You received this message because you are subscribed to a topic in the Google Groups "Slick / ScalaQuery" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scalaquery/9TzbDYbhqA0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scalaquery+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalaquery/e5349b94-bad6-4e7b-b919-986242735100%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages