Permalink
Browse files

Fix a performance bug with PostgreSQL

  • Loading branch information...
1 parent 3560aa9 commit cf39193fcc9c0de957a5bd179b91693dbd05f8b0 @snoyberg snoyberg committed Mar 25, 2011
@@ -29,6 +29,7 @@ import Data.ByteString (ByteString)
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import qualified Data.Text.Encoding.Error as T
+import Data.Time.LocalTime (localTimeToUTC, utc)
withPostgresqlPool :: MonadPeelIO m
=> String
@@ -118,6 +119,7 @@ pFromSql (H.SqlLocalDate d) = PersistDay d
pFromSql (H.SqlLocalTimeOfDay d) = PersistTimeOfDay d
pFromSql (H.SqlUTCTime d) = PersistUTCTime d
pFromSql H.SqlNull = PersistNull
+pFromSql (H.SqlLocalTime d) = PersistUTCTime $ localTimeToUTC utc d
pFromSql x = PersistString $ H.fromSql x -- FIXME
migrate' :: PersistEntity val
@@ -1,5 +1,5 @@
name: persistent-postgresql
-version: 0.4.0
+version: 0.4.0.1
license: BSD3
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>
@@ -23,6 +23,7 @@ library
, bytestring >= 0.9 && < 0.10
, text >= 0.7 && < 0.12
, monad-peel >= 0.1 && < 0.2
+ , time >= 1.1 && < 1.3
exposed-modules: Database.Persist.Postgresql
ghc-options: -Wall

0 comments on commit cf39193

Please sign in to comment.