title: Customer Type Mapper for Slick SQL
body: <p>I've found this example from slick testing:<br>
  <a href="https://github.com/slick/slick/blob/master/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/MapperTest.scala" rel="noreferrer">https://github.com/slick/slick/blob/master/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/MapperTest.scala</a></p>
  
  <pre><code>sealed trait Bool
  case object True extends Bool
  case object False extends Bool
  
  implicit val boolTypeMapper = MappedColumnType.base[Bool, String](
    { b =&gt;
      assertNotNull(b)
      if(b == True) "y" else "n"
    }, { i =&gt;
      assertNotNull(i)
      if(i == "y") True else False
    }
  )
  </code></pre>
  
  <p>But I'm trying to create a TypeMapper for org.joda.time.DateTime to/from java.sql.Timestamp - but without much success.  The Bool example is very particular and I'm having trouble adapting it.  Joda Time is super common - so any help would be much appreciated.</p>
  
  <p>To be clear, I'm using interpolated sql"""select colA,colB from tableA where id = ${id}""" and such.  When doing a select the system works well by using jodaDate types in the implicit GetResult converter.</p>
  
  <p>However, for inserts there doesn't seem to be a way to do an implicit conversion or it is ignoring the code provided below in Answer #1 - same error as before:
  could not find implicit value for parameter pconv: scala.slick.jdbc.SetParameter[(Option[Int], String, String, Option[org.joda.time.DateTime])]</p>
  
  <p>I'm not using the Lifted style Slick configuration with the annotated Table objects perhaps that is why it is not finding/using the TypeMapper </p>