Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

slick column not defined

Tags:

scala

slick

I am new in scala slick .
why can not found column and O in slick v3.1.1
please view this example code :

import slick.driver.PostgresDriver
import slick.lifted.Tag
import slick.model.Table ;

case class Person(id:Int,name:String)

class Persons(tag: Tag) extends Table[Person](tag , "PERSONS") {
    def id = column[Long]("id", O.PrimaryKey, O.AutoInc)
    def name = column[String]("name", O.NotNull)
}    

Update :
I use this document : http://slick.lightbend.com/doc/3.1.1/gettingstarted.html#schema

like image 936
mah454 Avatar asked Dec 16 '16 19:12

mah454


1 Answers

Simply change your import to:

import slick.driver.PostgresDriver.api._

Looking at your code - this should be the only import that you should need (at least at this stage).

like image 176
Paul Dolega Avatar answered Oct 29 '22 10:10

Paul Dolega