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.
- class LiteralSQL a where
- 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
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.