mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2024-11-29 06:37:03 +03:00
Support for ZonedTime and UTCTime
This commit is contained in:
parent
e6bb2bcada
commit
851a142e06
@ -160,6 +160,14 @@ instance ShowConstantTermsSQL TimeOfDay where
|
||||
instance ShowConstantTermsSQL LocalTime where
|
||||
showConstantTermsSQL' = constantTimeTerms TIMESTAMP "%Y-%m-%d %H:%M:%S"
|
||||
|
||||
-- | Constant SQL terms of 'ZonedTime'.
|
||||
instance ShowConstantTermsSQL ZonedTime where
|
||||
showConstantTermsSQL' = constantTimeTerms TIMESTAMPTZ "%Y-%m-%d %H:%M:%S%z"
|
||||
|
||||
-- | Constant SQL terms of 'ZonedTime'.
|
||||
instance ShowConstantTermsSQL UTCTime where
|
||||
showConstantTermsSQL' = constantTimeTerms TIMESTAMPTZ "%Y-%m-%d %H:%M:%S%z"
|
||||
|
||||
showMaybeTerms :: ShowConstantTermsSQL a => PersistableRecordWidth a -> Maybe a -> [StringSQL]
|
||||
showMaybeTerms wa = d where
|
||||
d (Just a) = showConstantTermsSQL' a
|
||||
|
@ -91,7 +91,7 @@ data Keyword = SELECT | ALL | DISTINCT | ON
|
||||
|
||||
| IS | NULL | IN
|
||||
|
||||
| DATE | TIME | TIMESTAMP | INTERVAL
|
||||
| DATE | TIME | TIMESTAMP | TIMESTAMPTZ | INTERVAL
|
||||
|
||||
| Sequence !DString
|
||||
deriving (Read, Show)
|
||||
|
Loading…
Reference in New Issue
Block a user