nafg/slick-additions

JdbcProfile TypeInfo for slick-joda-mapper integration

rowlandwatkins opened this issue · 4 comments

Hi,

I'm trying to use slick-joda-mapper with slick-additions, however, I'm hitting the following hurdle:

JdbcProfile has no TypeInfo for type com.github.tototoshi.slick.JodaDateTimeMapper$TypeMappers$/TIMESTAMP

My driver extends the scala.slick.driver.H2Driver with KeyedTableComponent

Since KeyTableComponent extends JdbcProfile this might be causing some hassle, but I'm not sure.

Any hints on how to use Joda datatypes?

Cheers,

Rowland

So, for time being I'm using a mapper from DateTime to Timestamp:

implicit def timestamp2dateTime = MappedColumnType.base[DateTime, Timestamp] (
    dt => new Timestamp(dt.getMillis),
    ts => new DateTime(ts.getTime)
)
nafg commented

I'm really sorry for not noticing this before.
What does your code look like exactly?
On Jun 18, 2014 3:29 AM, "Rowland Watkins" notifications@github.com
wrote:

Hi,

I'm trying to use slick-joda-mapper with slick-additions, however, I'm
hitting the following hurdle:

JdbcProfile has no TypeInfo for type
com.github.tototoshi.slick.JodaDateTimeMapper$TypeMappers$/TIMESTAMP

My driver extends the scala.slick.driver.H2Driver with KeyedTableComponent

Since KeyTableComponent extends JdbcProfile this might be causing some
hassle, but I'm not sure.

Any hints on how to use Joda datatypes?

Cheers,

Rowland

Reply to this email directly or view it on GitHub
#8.

nafg commented

That looks like the right thing to do, what were you doing before?
On Jun 18, 2014 4:27 AM, "Rowland Watkins" notifications@github.com
wrote:

So, for the time being I've just created my own mapper for jodatime
DateTime to java.sql.Timestamp:
[[[
implicit def timestamp2dateTime = MappedColumnType.baseDateTime, Timestamp
]]]

Reply to this email directly or view it on GitHub
#8 (comment).

nafg commented

@rowlandwatkins can you please respond, if this is solved please close the issue.