mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2025-01-08 14:26:33 +03:00
merged.
This commit is contained in:
commit
976a499eee
@ -29,7 +29,7 @@ import qualified Data.Text as T
|
||||
import qualified Data.Text.Encoding as T
|
||||
import qualified Data.Text.Lazy as LT
|
||||
import Text.Printf (PrintfArg, printf)
|
||||
import Data.Time (FormatTime, Day, TimeOfDay, LocalTime, formatTime)
|
||||
import Data.Time (FormatTime, Day, TimeOfDay, LocalTime, UTCTime, ZonedTime, formatTime)
|
||||
import Data.Time.Locale.Compat (defaultTimeLocale)
|
||||
|
||||
import Language.SQL.Keyword (Keyword (..))
|
||||
@ -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