relational-query-0.10.1.1: Typeful, Modular, Relational, algebraic query engine

Copyright2017 Kei Hibino
LicenseBSD3
Maintainerex8k.hibino@gmail.com
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Database.Relational.ProjectableClass

Contents

Description

This module provides interfaces to preserve constraints of direct product projections.

Synopsis

Literal SQL terms

class ShowConstantTermsSQL a where Source #

ShowConstantTermsSQL a is implicit rule to derive function to convert from haskell record type a into constant SQL terms.

Generic programming (https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#generic-programming) with default signature is available for ShowConstantTermsSQL class, so you can make instance like below:

  {-# LANGUAGE DeriveGeneric #-}
  import GHC.Generics (Generic)
  --
  data Foo = Foo { ... } deriving Generic
  instance ShowConstantTermsSQL Foo

Methods

showConstantTermsSQL' :: a -> DList StringSQL Source #

showConstantTermsSQL' :: (Generic a, GShowConstantTermsSQL (Rep a)) => a -> DList StringSQL Source #

showConstantTermsSQL :: ShowConstantTermsSQL a => a -> [StringSQL] Source #

Convert from haskell record to SQL terms list.

type StringSQL = Keyword Source #

String wrap type for SQL strings.