| Copyright | 2017 Kei Hibino |
|---|---|
| License | BSD3 |
| Maintainer | ex8k.hibino@gmail.com |
| Stability | experimental |
| Portability | unknown |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Database.Relational.ProjectableClass
Contents
Description
This module provides interfaces to preserve constraints of direct product projections.
Synopsis
- class LiteralSQL a where
- showLiteral' :: a -> DList StringSQL
- showLiteral :: LiteralSQL a => a -> [StringSQL]
- type StringSQL = Keyword
- type ShowConstantTermsSQL = LiteralSQL
- showConstantTermsSQL' :: ShowConstantTermsSQL a => a -> DList StringSQL
- showConstantTermsSQL :: ShowConstantTermsSQL a => a -> [StringSQL]
Literal SQL terms
class LiteralSQL a where Source #
LiteralSQL a is implicit rule to derive function to convert
from haskell record type a into SQL literal row-value.
Generic programming (https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#generic-programming)
with default signature is available for LiteralSQL class,
so you can make instance like below:
{-# LANGUAGE DeriveGeneric #-}
import GHC.Generics (Generic)
--
data Foo = Foo { ... } deriving Generic
instance LiteralSQL Foo
Minimal complete definition
Nothing
Methods
showLiteral' :: a -> DList StringSQL Source #
default showLiteral' :: (Generic a, GLiteralSQL (Rep a)) => a -> DList StringSQL Source #
Instances
| LiteralSQL Bool Source # | Constant SQL terms of |
Defined in Database.Relational.Pure Methods showLiteral' :: Bool -> DList StringSQL Source # | |
| LiteralSQL Char Source # | Constant SQL terms of |
Defined in Database.Relational.Pure Methods showLiteral' :: Char -> DList StringSQL Source # | |
| LiteralSQL Double Source # | Constant SQL terms of |
Defined in Database.Relational.Pure Methods showLiteral' :: Double -> DList StringSQL Source # | |
| LiteralSQL Float Source # | Constant SQL terms of |
Defined in Database.Relational.Pure Methods showLiteral' :: Float -> DList StringSQL Source # | |
| LiteralSQL Int Source # | Constant SQL terms of |
Defined in Database.Relational.Pure Methods showLiteral' :: Int -> DList StringSQL Source # | |
| LiteralSQL Int8 Source # | Constant SQL terms of |
Defined in Database.Relational.Pure Methods showLiteral' :: Int8 -> DList StringSQL Source # | |
| LiteralSQL Int16 Source # | Constant SQL terms of |
Defined in Database.Relational.Pure Methods showLiteral' :: Int16 -> DList StringSQL Source # | |
| LiteralSQL Int32 Source # | Constant SQL terms of |
Defined in Database.Relational.Pure Methods showLiteral' :: Int32 -> DList StringSQL Source # | |
| LiteralSQL Int64 Source # | Constant SQL terms of |
Defined in Database.Relational.Pure Methods showLiteral' :: Int64 -> DList StringSQL Source # | |
| LiteralSQL Integer Source # | |
Defined in Database.Relational.Pure Methods showLiteral' :: Integer -> DList StringSQL Source # | |
| LiteralSQL Word Source # | Constant SQL terms of |
Defined in Database.Relational.Pure Methods showLiteral' :: Word -> DList StringSQL Source # | |
| LiteralSQL Word8 Source # | Constant SQL terms of |
Defined in Database.Relational.Pure Methods showLiteral' :: Word8 -> DList StringSQL Source # | |
| LiteralSQL Word16 Source # | Constant SQL terms of |
Defined in Database.Relational.Pure Methods showLiteral' :: Word16 -> DList StringSQL Source # | |
| LiteralSQL Word32 Source # | Constant SQL terms of |
Defined in Database.Relational.Pure Methods showLiteral' :: Word32 -> DList StringSQL Source # | |
| LiteralSQL Word64 Source # | Constant SQL terms of |
Defined in Database.Relational.Pure Methods showLiteral' :: Word64 -> DList StringSQL Source # | |
| LiteralSQL () Source # | Constant SQL terms of |
Defined in Database.Relational.Pure Methods showLiteral' :: () -> DList StringSQL Source # | |
| LiteralSQL String Source # | Constant SQL terms of |
Defined in Database.Relational.Pure Methods showLiteral' :: String -> DList StringSQL Source # | |
| LiteralSQL Day Source # | Constant SQL terms of |
Defined in Database.Relational.Pure Methods showLiteral' :: Day -> DList StringSQL Source # | |
| LiteralSQL UTCTime Source # | Constant SQL terms of |
Defined in Database.Relational.NonStandard.PureTimestampTZ Methods showLiteral' :: UTCTime -> DList StringSQL Source # | |
| LiteralSQL LocalTime Source # | Constant SQL terms of |
Defined in Database.Relational.Pure Methods showLiteral' :: LocalTime -> DList StringSQL Source # | |
| LiteralSQL TimeOfDay Source # | Constant SQL terms of |
Defined in Database.Relational.Pure Methods showLiteral' :: TimeOfDay -> DList StringSQL Source # | |
| LiteralSQL ZonedTime Source # | Constant SQL terms of |
Defined in Database.Relational.NonStandard.PureTimestampTZ Methods showLiteral' :: ZonedTime -> DList StringSQL Source # | |
| LiteralSQL Text Source # | Constant SQL terms of |
Defined in Database.Relational.Pure Methods showLiteral' :: Text -> DList StringSQL Source # | |
| LiteralSQL ByteString Source # | Constant SQL terms of |
Defined in Database.Relational.PureUTF8 Methods showLiteral' :: ByteString -> DList StringSQL Source # | |
| LiteralSQL Text Source # | Constant SQL terms of |
Defined in Database.Relational.Pure Methods showLiteral' :: Text -> DList StringSQL Source # | |
| LiteralSQL ByteString Source # | Constant SQL terms of |
Defined in Database.Relational.PureUTF8 Methods showLiteral' :: ByteString -> DList StringSQL Source # | |
| (PersistableWidth a, LiteralSQL a) => LiteralSQL (Maybe a) Source # | Constant SQL terms of |
Defined in Database.Relational.Pure Methods showLiteral' :: Maybe a -> DList StringSQL Source # | |
| (LiteralSQL a1, LiteralSQL a2) => LiteralSQL (a1, a2) Source # | |
Defined in Database.Relational.TupleInstances Methods showLiteral' :: (a1, a2) -> DList StringSQL Source # | |
| (LiteralSQL a1, LiteralSQL a2, LiteralSQL a3) => LiteralSQL (a1, a2, a3) Source # | |
Defined in Database.Relational.TupleInstances Methods showLiteral' :: (a1, a2, a3) -> DList StringSQL Source # | |
| (LiteralSQL a1, LiteralSQL a2, LiteralSQL a3, LiteralSQL a4) => LiteralSQL (a1, a2, a3, a4) Source # | |
Defined in Database.Relational.TupleInstances Methods showLiteral' :: (a1, a2, a3, a4) -> DList StringSQL Source # | |
| (LiteralSQL a1, LiteralSQL a2, LiteralSQL a3, LiteralSQL a4, LiteralSQL a5) => LiteralSQL (a1, a2, a3, a4, a5) Source # | |
Defined in Database.Relational.TupleInstances Methods showLiteral' :: (a1, a2, a3, a4, a5) -> DList StringSQL Source # | |
| (LiteralSQL a1, LiteralSQL a2, LiteralSQL a3, LiteralSQL a4, LiteralSQL a5, LiteralSQL a6) => LiteralSQL (a1, a2, a3, a4, a5, a6) Source # | |
Defined in Database.Relational.TupleInstances Methods showLiteral' :: (a1, a2, a3, a4, a5, a6) -> DList StringSQL Source # | |
| (LiteralSQL a1, LiteralSQL a2, LiteralSQL a3, LiteralSQL a4, LiteralSQL a5, LiteralSQL a6, LiteralSQL a7) => LiteralSQL (a1, a2, a3, a4, a5, a6, a7) Source # | |
Defined in Database.Relational.TupleInstances Methods showLiteral' :: (a1, a2, a3, a4, a5, a6, a7) -> DList StringSQL Source # | |
showLiteral :: LiteralSQL a => a -> [StringSQL] Source #
Convert from haskell record to SQL literal row-value.
Deprecated.
type ShowConstantTermsSQL = LiteralSQL Source #
Deprecated: Use LiteralSQL instead of this.
Deprecated.
showConstantTermsSQL' :: ShowConstantTermsSQL a => a -> DList StringSQL Source #
Deprecated: Use showLiteral` instead of this.
showConstantTermsSQL :: ShowConstantTermsSQL a => a -> [StringSQL] Source #
Deprecated: Use showLiteral instead of this.
Deprecated.