mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2024-11-22 03:06:01 +03:00
Merge 0ba503ad98
into 2805670712
This commit is contained in:
commit
a5d03819d6
@ -15,6 +15,8 @@
|
||||
module Database.Relational.Pure () where
|
||||
|
||||
import Control.Applicative (pure)
|
||||
import qualified Data.ByteString.Char8 as BC
|
||||
import qualified Data.ByteString.Lazy.Char8 as BCL
|
||||
import Data.Int (Int8, Int16, Int32, Int64)
|
||||
import Data.Word (Word8, Word16, Word32, Word64, Word)
|
||||
import Data.Text (Text)
|
||||
@ -130,6 +132,12 @@ instance LiteralSQL TimeOfDay where
|
||||
instance LiteralSQL LocalTime where
|
||||
showLiteral' = pure . Lit.timestamp TIMESTAMP "%Y-%m-%d %H:%M:%S"
|
||||
|
||||
instance LiteralSQL BC.ByteString where
|
||||
showLiteral' = pure . Lit.stringExpr . BC.unpack
|
||||
|
||||
instance LiteralSQL BCL.ByteString where
|
||||
showLiteral' = pure . Lit.stringExpr . BCL.unpack
|
||||
|
||||
showMaybeTerms :: LiteralSQL a => PersistableRecordWidth a -> Maybe a -> DList StringSQL
|
||||
showMaybeTerms wa = d where
|
||||
d (Just a) = showLiteral' a
|
||||
|
Loading…
Reference in New Issue
Block a user