Slick 2.0.0-M2: How to define custom types (MappedTypeMapper in slick 1.0.0)?

I want to define a custom type in slick 2.0.0-M2. The type has the base type scala, which is known as slick (e.g. String). In Slick 1.0.0, I could do something like:

class Test[UnderlyingType : TypeMapper] {
  case class MyType(elem: UnderlyingType)

  implicit val typeMapper = MappedTypeMapper.base[MyType, UnderlyingType](_.elem, t=>MyType(t))
}

(the code above was not tested, but my implementation was like this)

How does it work in slick 2.0.0-M2? The MappedTypeMapper class has disappeared ...

+4
source share
1 answer
+4
source

All Articles