Hi,

going deeper i found the following:

http://hackage.haskell.org/packages/archive/haskelldb-hdbc/2.1.0/doc/html/src/Database-HaskellDB-HDBC.html#line-126

HaskellDB is converting from SqlTimestampT (no timezone defined) to
CalendarTimeT (timezone required). This conversion tries then to be done
using LocalTime (
http://hackage.haskell.org/packages/archive/HDBC/2.2.6.1/doc/html/src/Database-HDBC-SqlValue.html#line-735
)
 which fails.

I believe real problem is CalendarTimeT. SqlTimestampT clearly doesn't
define a timezone. There's a need to create a new type to handle these
types. Timestamps but no timezone (Localtime).

I attach a patch for this. I tested this in a project. Not quite sure how
to add the tests. What should i do to add this patch to haskell? A version
dependency of this two should be added,

Andras


2012/9/29 Andras Gyomrey <lgand...@gmail.com>

> Hi,
>
> I get
>
> *** Exception: Convertible: error converting source data SqlLocalTime
> 2012-04-27 10:22:15 of type SqlValue to type
> Data.Time.LocalTime.LocalTime.ZonedTime: incompatible types
>
> when i try to show a record with a field of type CalendarTime
> (automatically generated by Database.HaskellDB.DBDirect, Mysql database
> type is "timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
> CURRENT_TIMESTAMP"
>
> I already looked forhttp://
> haskell.1045720.n5.nabble.com/programmatic-DB-interface-td3120759.html.
> But the problem there is about a regexp (not a type). And the incompatible
> type problem was caused because of a concatenation. Here, as you can see, i
> have no idea what's going on.
>
> Can someone please help me?
>
> Andras
>
>

Attachment: haskelldb-2.1.1.patch
Description: Binary data

Attachment: haskelldb-hdbc-2.1.0.patch
Description: Binary data

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to