This commit is contained in:
Fumiaki Kinoshita 2023-12-03 02:09:09 +09:00 committed by GitHub
commit a5d03819d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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