14

I am writing a web application in play framework. I decided to use slick (FRM) to query in my database (postgre). I am new to slick so I started following slick official document for revision 3.0.0 http://slick.typesafe.com/doc/3.0.0/gettingstarted.html

As per the documentation, I added dependencies in my build.sbt file

libraryDependencies ++= Seq(
  "com.typesafe.slick" %% "slick" % "3.0.0",
  "org.slf4j" % "slf4j-nop" % "1.6.4"
)

Everything else is working fine but while writing below line in my Scala IDE. It is showing error that

value seq is not a member of object slick.dbio.DBIO

val setup = DBIO.seq(
// Above line is showing error

(suppliers.schema ++ coffees.schema).create,
.
.
.
)

In fact Scala IDE (same as eclipse IDE) isn't detecting any member of object DBIO though when I browse slick api of same version http://slick.typesafe.com/doc/3.0.0/api/#slick.dbio.DBIO$ for object DBIO I am seeing seq as it's member.

Where am I doing wrong?

Vinay
  • 1,280
  • 2
  • 13
  • 18
  • I opened a bug with scala ide: https://www.assembla.com/spaces/scala-ide/support/tickets/1002527 – Chris Scott Aug 05 '15 at 15:08
  • I tracked the problem to a known bug in the presentation compiler and REPL, and submitted a workaround for the next release of Slick: http://stackoverflow.com/questions/30436661/error-value-seq-is-not-a-member-of-object-slick-dbio-dbio – retronym Aug 06 '15 at 12:14
  • @retronym can you fix your link? You're just linking back here with your work-around. – Chris Scott Aug 12 '15 at 16:27
  • Looks like it's this pull-request: https://github.com/slick/slick/pull/1224 This will probably hit slick in 3.1. – Chris Scott Aug 13 '15 at 13:57

3 Answers3

1

As anticipated by retronym and Chris Scot, this problem was fixed with the release of Slick 3.1

Richard Dallaway
  • 4,250
  • 1
  • 28
  • 39
  • Slick 3.1.1: the problem is still here (````TripSaver.scala:20: value Seq is not a member of object slick.dbio.DBIOAction [error] val insert = DBIO.Seq(checkpoints map (POI(None, _, None)) map (T.POIs += _))```` – Vitaly Isaev Sep 11 '16 at 16:23
  • @VitalyIsaev can you check with a lower-case `s` in `DBIO.seq` (not `DBIO.Seq`)? – Richard Dallaway Sep 12 '16 at 10:12
0

You need to import the API for the database you are using:

import slick.driver.PostgresDriver.api._
wongelz
  • 119
  • 1
  • 2
0

I'm not sure if you've got your answer (I'm answering for those that may stumble upon this in the future), but I've resolved this by upgrading to 3.0.0-M1 and using Action.seq() instead of DBIO.seq()

This may also work in 3.0.0, but I'm not sure as I upgraded from Slick 2.x to 3.0.0-M1!