squeal-postgresql-0.5.2.0: Squeal PostgreSQL Library

Copyright(c) Eitan Chatav 2019
Maintainereitan@morphism.tech
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Squeal.PostgreSQL.Expression

Contents

Description

Squeal expressions are the atoms used to build statements.

Synopsis

Expression

newtype Expression (outer :: FromType) (commons :: FromType) (grp :: Grouping) (schemas :: SchemasType) (params :: [NullityType]) (from :: FromType) (ty :: NullityType) Source #

Expressions are used in a variety of contexts, such as in the target List of the select command, as new column values in insertRow or update, or in search Conditions in a number of commands.

The expression syntax allows the calculation of values from primitive expression using arithmetic, logical, and other operations.

The type parameters of Expression are

Instances
(Has tab (Join outer from) row, Has col row ty, GroupedBy tab col bys, columns ~ ((col ::: ty) ': ([] :: [(Symbol, NullityType)]))) => IsQualified tab col (NP (Aliased (Expression outer commons (Grouped bys) schemas params from)) columns) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(!) :: Alias tab -> Alias col -> NP (Aliased (Expression outer commons (Grouped bys) schemas params from)) columns Source #

(Has tab (Join outer from) row, Has col row ty, GroupedBy tab col bys, column ~ (col ::: ty)) => IsQualified tab col (Aliased (Expression outer commons (Grouped bys) schemas params from) column) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(!) :: Alias tab -> Alias col -> Aliased (Expression outer commons (Grouped bys) schemas params from) column Source #

(Has tab (Join outer from) row, Has col row ty, GroupedBy tab col bys, tys ~ (ty ': ([] :: [NullityType]))) => IsQualified tab col (NP (Expression outer commons (Grouped bys) schemas params from) tys) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(!) :: Alias tab -> Alias col -> NP (Expression outer commons (Grouped bys) schemas params from) tys Source #

(Has tab (Join outer from) row, Has col row ty, columns ~ ((col ::: ty) ': ([] :: [(Symbol, NullityType)]))) => IsQualified tab col (NP (Aliased (Expression outer commons Ungrouped schemas params from)) columns) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(!) :: Alias tab -> Alias col -> NP (Aliased (Expression outer commons Ungrouped schemas params from)) columns Source #

(Has tab (Join outer from) row, Has col row ty, column ~ (col ::: ty)) => IsQualified tab col (Aliased (Expression outer commons Ungrouped schemas params from) column) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(!) :: Alias tab -> Alias col -> Aliased (Expression outer commons Ungrouped schemas params from) column Source #

(Has tab (Join outer from) row, Has col row ty, tys ~ (ty ': ([] :: [NullityType]))) => IsQualified tab col (NP (Expression outer commons Ungrouped schemas params from) tys) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(!) :: Alias tab -> Alias col -> NP (Expression outer commons Ungrouped schemas params from) tys Source #

(Has tab (Join outer from) row, Has col row ty, GroupedBy tab col bys) => IsQualified tab col (Expression outer commons (Grouped bys) schemas params from ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(!) :: Alias tab -> Alias col -> Expression outer commons (Grouped bys) schemas params from ty Source #

(Has tab (Join outer from) row, Has col row ty) => IsQualified tab col (Expression outer commons Ungrouped schemas params from ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(!) :: Alias tab -> Alias col -> Expression outer commons Ungrouped schemas params from ty Source #

Aggregate (Distinction (Expression outer commons Ungrouped schemas params from)) (Distinction (NP (Expression outer commons Ungrouped schemas params from)) :: [NullityType] -> Type) (Expression outer commons (Grouped bys) schemas params from) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Aggregate

Methods

countStar :: Expression outer commons (Grouped bys) schemas params from (NotNull PGint8) Source #

count :: Distinction (Expression outer commons Ungrouped schemas params from) ty -> Expression outer commons (Grouped bys) schemas params from (NotNull PGint8) Source #

sum_ :: Distinction (Expression outer commons Ungrouped schemas params from) (null ty) -> Expression outer commons (Grouped bys) schemas params from (Null (PGSum ty)) Source #

arrayAgg :: Distinction (Expression outer commons Ungrouped schemas params from) ty -> Expression outer commons (Grouped bys) schemas params from (Null (PGvararray ty)) Source #

jsonAgg :: Distinction (Expression outer commons Ungrouped schemas params from) ty -> Expression outer commons (Grouped bys) schemas params from (Null PGjson) Source #

jsonbAgg :: Distinction (Expression outer commons Ungrouped schemas params from) ty -> Expression outer commons (Grouped bys) schemas params from (Null PGjsonb) Source #

bitAnd :: In int PGIntegral => Distinction (Expression outer commons Ungrouped schemas params from) (null int) -> Expression outer commons (Grouped bys) schemas params from (Null int) Source #

bitOr :: In int PGIntegral => Distinction (Expression outer commons Ungrouped schemas params from) (null int) -> Expression outer commons (Grouped bys) schemas params from (Null int) Source #

boolAnd :: Distinction (Expression outer commons Ungrouped schemas params from) (null PGbool) -> Expression outer commons (Grouped bys) schemas params from (Null PGbool) Source #

boolOr :: Distinction (Expression outer commons Ungrouped schemas params from) (null PGbool) -> Expression outer commons (Grouped bys) schemas params from (Null PGbool) Source #

every :: Distinction (Expression outer commons Ungrouped schemas params from) (null PGbool) -> Expression outer commons (Grouped bys) schemas params from (Null PGbool) Source #

max_ :: Distinction (Expression outer commons Ungrouped schemas params from) (null ty) -> Expression outer commons (Grouped bys) schemas params from (Null ty) Source #

min_ :: Distinction (Expression outer commons Ungrouped schemas params from) (null ty) -> Expression outer commons (Grouped bys) schemas params from (Null ty) Source #

avg :: Distinction (Expression outer commons Ungrouped schemas params from) (null ty) -> Expression outer commons (Grouped bys) schemas params from (Null (PGAvg ty)) Source #

corr :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGfloat8) Source #

covarPop :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGfloat8) Source #

covarSamp :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGfloat8) Source #

regrAvgX :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGfloat8) Source #

regrAvgY :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGfloat8) Source #

regrCount :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGint8) Source #

regrIntercept :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGfloat8) Source #

regrR2 :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGfloat8) Source #

regrSlope :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGfloat8) Source #

regrSxx :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGfloat8) Source #

regrSxy :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGfloat8) Source #

regrSyy :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGfloat8) Source #

stddev :: Distinction (Expression outer commons Ungrouped schemas params from) (null ty) -> Expression outer commons (Grouped bys) schemas params from (Null (PGAvg ty)) Source #

stddevPop :: Distinction (Expression outer commons Ungrouped schemas params from) (null ty) -> Expression outer commons (Grouped bys) schemas params from (Null (PGAvg ty)) Source #

stddevSamp :: Distinction (Expression outer commons Ungrouped schemas params from) (null ty) -> Expression outer commons (Grouped bys) schemas params from (Null (PGAvg ty)) Source #

variance :: Distinction (Expression outer commons Ungrouped schemas params from) (null ty) -> Expression outer commons (Grouped bys) schemas params from (Null (PGAvg ty)) Source #

varPop :: Distinction (Expression outer commons Ungrouped schemas params from) (null ty) -> Expression outer commons (Grouped bys) schemas params from (Null (PGAvg ty)) Source #

varSamp :: Distinction (Expression outer commons Ungrouped schemas params from) (null ty) -> Expression outer commons (Grouped bys) schemas params from (Null (PGAvg ty)) Source #

(HasUnique tab (Join outer from) row, Has col row ty, GroupedBy tab col bys, columns ~ ((col ::: ty) ': ([] :: [(Symbol, NullityType)]))) => IsLabel col (NP (Aliased (Expression outer commons (Grouped bys) schemas params from)) columns) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: NP (Aliased (Expression outer commons (Grouped bys) schemas params from)) columns #

(HasUnique tab (Join outer from) row, Has col row ty, GroupedBy tab col bys, column ~ (col ::: ty)) => IsLabel col (Aliased (Expression outer commons (Grouped bys) schemas params from) column) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: Aliased (Expression outer commons (Grouped bys) schemas params from) column #

(HasUnique tab (Join outer from) row, Has col row ty, GroupedBy tab col bys, tys ~ (ty ': ([] :: [NullityType]))) => IsLabel col (NP (Expression outer commons (Grouped bys) schemas params from) tys) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: NP (Expression outer commons (Grouped bys) schemas params from) tys #

(HasUnique tab (Join outer from) row, Has col row ty, columns ~ ((col ::: ty) ': ([] :: [(Symbol, NullityType)]))) => IsLabel col (NP (Aliased (Expression outer commons Ungrouped schemas params from)) columns) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: NP (Aliased (Expression outer commons Ungrouped schemas params from)) columns #

(HasUnique tab (Join outer from) row, Has col row ty, column ~ (col ::: ty)) => IsLabel col (Aliased (Expression outer commons Ungrouped schemas params from) column) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: Aliased (Expression outer commons Ungrouped schemas params from) column #

(HasUnique tab (Join outer from) row, Has col row ty, tys ~ (ty ': ([] :: [NullityType]))) => IsLabel col (NP (Expression outer commons Ungrouped schemas params from) tys) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: NP (Expression outer commons Ungrouped schemas params from) tys #

Aggregate (Expression outer commons grp schemas params from) (NP (Expression outer commons grp schemas params from) :: [NullityType] -> Type) (WindowFunction outer commons grp schemas params from) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Window

Methods

countStar :: WindowFunction outer commons grp schemas params from (NotNull PGint8) Source #

count :: Expression outer commons grp schemas params from ty -> WindowFunction outer commons grp schemas params from (NotNull PGint8) Source #

sum_ :: Expression outer commons grp schemas params from (null ty) -> WindowFunction outer commons grp schemas params from (Null (PGSum ty)) Source #

arrayAgg :: Expression outer commons grp schemas params from ty -> WindowFunction outer commons grp schemas params from (Null (PGvararray ty)) Source #

jsonAgg :: Expression outer commons grp schemas params from ty -> WindowFunction outer commons grp schemas params from (Null PGjson) Source #

jsonbAgg :: Expression outer commons grp schemas params from ty -> WindowFunction outer commons grp schemas params from (Null PGjsonb) Source #

bitAnd :: In int PGIntegral => Expression outer commons grp schemas params from (null int) -> WindowFunction outer commons grp schemas params from (Null int) Source #

bitOr :: In int PGIntegral => Expression outer commons grp schemas params from (null int) -> WindowFunction outer commons grp schemas params from (Null int) Source #

boolAnd :: Expression outer commons grp schemas params from (null PGbool) -> WindowFunction outer commons grp schemas params from (Null PGbool) Source #

boolOr :: Expression outer commons grp schemas params from (null PGbool) -> WindowFunction outer commons grp schemas params from (Null PGbool) Source #

every :: Expression outer commons grp schemas params from (null PGbool) -> WindowFunction outer commons grp schemas params from (Null PGbool) Source #

max_ :: Expression outer commons grp schemas params from (null ty) -> WindowFunction outer commons grp schemas params from (Null ty) Source #

min_ :: Expression outer commons grp schemas params from (null ty) -> WindowFunction outer commons grp schemas params from (Null ty) Source #

avg :: Expression outer commons grp schemas params from (null ty) -> WindowFunction outer commons grp schemas params from (Null (PGAvg ty)) Source #

corr :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGfloat8) Source #

covarPop :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGfloat8) Source #

covarSamp :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGfloat8) Source #

regrAvgX :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGfloat8) Source #

regrAvgY :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGfloat8) Source #

regrCount :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGint8) Source #

regrIntercept :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGfloat8) Source #

regrR2 :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGfloat8) Source #

regrSlope :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGfloat8) Source #

regrSxx :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGfloat8) Source #

regrSxy :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGfloat8) Source #

regrSyy :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGfloat8) Source #

stddev :: Expression outer commons grp schemas params from (null ty) -> WindowFunction outer commons grp schemas params from (Null (PGAvg ty)) Source #

stddevPop :: Expression outer commons grp schemas params from (null ty) -> WindowFunction outer commons grp schemas params from (Null (PGAvg ty)) Source #

stddevSamp :: Expression outer commons grp schemas params from (null ty) -> WindowFunction outer commons grp schemas params from (Null (PGAvg ty)) Source #

variance :: Expression outer commons grp schemas params from (null ty) -> WindowFunction outer commons grp schemas params from (Null (PGAvg ty)) Source #

varPop :: Expression outer commons grp schemas params from (null ty) -> WindowFunction outer commons grp schemas params from (Null (PGAvg ty)) Source #

varSamp :: Expression outer commons grp schemas params from (null ty) -> WindowFunction outer commons grp schemas params from (Null (PGAvg ty)) Source #

(HasUnique tab (Join outer from) row, Has col row ty, GroupedBy tab col bys) => IsLabel col (Expression outer commons (Grouped bys) schemas params from ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: Expression outer commons (Grouped bys) schemas params from ty #

(HasUnique tab (Join outer from) row, Has col row ty) => IsLabel col (Expression outer commons Ungrouped schemas params from ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: Expression outer commons Ungrouped schemas params from ty #

(KnownSymbol label, In label labels) => IsPGlabel label (Expression outer commons grp schemas params from (null (PGenum labels))) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

label :: Expression outer commons grp schemas params from (null (PGenum labels)) Source #

(KnownSymbol col, row ~ ((col ::: ty) ': ([] :: [(Symbol, NullityType)]))) => Aliasable col (Expression outer commons grp schemas params from ty) (Selection outer commons grp schemas params from row) Source # 
Instance details

Defined in Squeal.PostgreSQL.Query

Methods

as :: Expression outer commons grp schemas params from ty -> Alias col -> Selection outer commons grp schemas params from row Source #

NFData (Distinction (Expression outer commons grp schemas params from) ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Aggregate

Methods

rnf :: Distinction (Expression outer commons grp schemas params from) ty -> () #

SListI tys => RenderSQL (Distinction (NP (Expression outer commons grp schemas params from)) tys) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Aggregate

Methods

renderSQL :: Distinction (NP (Expression outer commons grp schemas params from)) tys -> ByteString Source #

RenderSQL (Distinction (Expression outer commons grp schemas params from) ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Aggregate

Methods

renderSQL :: Distinction (Expression outer commons grp schemas params from) ty -> ByteString Source #

Eq (Expression outer commons grp schemas params from ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(==) :: Expression outer commons grp schemas params from ty -> Expression outer commons grp schemas params from ty -> Bool #

(/=) :: Expression outer commons grp schemas params from ty -> Expression outer commons grp schemas params from ty -> Bool #

(In ty PGNum, In ty PGFloating) => Floating (Expression outer commons grp schemas params from (null ty)) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

pi :: Expression outer commons grp schemas params from (null ty) #

exp :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

log :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

sqrt :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

(**) :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

logBase :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

sin :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

cos :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

tan :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

asin :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

acos :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

atan :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

sinh :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

cosh :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

tanh :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

asinh :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

acosh :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

atanh :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

log1p :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

expm1 :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

log1pexp :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

log1mexp :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

(In ty PGNum, In ty PGFloating) => Fractional (Expression outer commons grp schemas params from (null ty)) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(/) :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

recip :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

fromRational :: Rational -> Expression outer commons grp schemas params from (null ty) #

In ty PGNum => Num (Expression outer commons grp schemas params from (null ty)) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(+) :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

(-) :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

(*) :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

negate :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

abs :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

signum :: Expression outer commons grp schemas params from (null ty) -> Expression outer commons grp schemas params from (null ty) #

fromInteger :: Integer -> Expression outer commons grp schemas params from (null ty) #

Ord (Expression outer commons grp schemas params from ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

compare :: Expression outer commons grp schemas params from ty -> Expression outer commons grp schemas params from ty -> Ordering #

(<) :: Expression outer commons grp schemas params from ty -> Expression outer commons grp schemas params from ty -> Bool #

(<=) :: Expression outer commons grp schemas params from ty -> Expression outer commons grp schemas params from ty -> Bool #

(>) :: Expression outer commons grp schemas params from ty -> Expression outer commons grp schemas params from ty -> Bool #

(>=) :: Expression outer commons grp schemas params from ty -> Expression outer commons grp schemas params from ty -> Bool #

max :: Expression outer commons grp schemas params from ty -> Expression outer commons grp schemas params from ty -> Expression outer commons grp schemas params from ty #

min :: Expression outer commons grp schemas params from ty -> Expression outer commons grp schemas params from ty -> Expression outer commons grp schemas params from ty #

Show (Expression outer commons grp schemas params from ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

showsPrec :: Int -> Expression outer commons grp schemas params from ty -> ShowS #

show :: Expression outer commons grp schemas params from ty -> String #

showList :: [Expression outer commons grp schemas params from ty] -> ShowS #

IsString (Expression outer commons grp schemas params from (null PGtsquery)) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromString :: String -> Expression outer commons grp schemas params from (null PGtsquery) #

IsString (Expression outer commons grp schemas params from (null PGtsvector)) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromString :: String -> Expression outer commons grp schemas params from (null PGtsvector) #

IsString (Expression outer commons grp schemas params from (null PGtext)) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromString :: String -> Expression outer commons grp schemas params from (null PGtext) #

Generic (Expression outer commons grp schemas params from ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Associated Types

type Rep (Expression outer commons grp schemas params from ty) :: Type -> Type #

Methods

from :: Expression outer commons grp schemas params from ty -> Rep (Expression outer commons grp schemas params from ty) x #

to :: Rep (Expression outer commons grp schemas params from ty) x -> Expression outer commons grp schemas params from ty #

Semigroup (Expression outer commons grp schemas params from (null PGtsvector)) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(<>) :: Expression outer commons grp schemas params from (null PGtsvector) -> Expression outer commons grp schemas params from (null PGtsvector) -> Expression outer commons grp schemas params from (null PGtsvector) #

sconcat :: NonEmpty (Expression outer commons grp schemas params from (null PGtsvector)) -> Expression outer commons grp schemas params from (null PGtsvector) #

stimes :: Integral b => b -> Expression outer commons grp schemas params from (null PGtsvector) -> Expression outer commons grp schemas params from (null PGtsvector) #

Semigroup (Expression outer commons grp schemas params from (null PGtext)) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(<>) :: Expression outer commons grp schemas params from (null PGtext) -> Expression outer commons grp schemas params from (null PGtext) -> Expression outer commons grp schemas params from (null PGtext) #

sconcat :: NonEmpty (Expression outer commons grp schemas params from (null PGtext)) -> Expression outer commons grp schemas params from (null PGtext) #

stimes :: Integral b => b -> Expression outer commons grp schemas params from (null PGtext) -> Expression outer commons grp schemas params from (null PGtext) #

Semigroup (Expression outer commons grp schemas params from (null PGjsonb)) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(<>) :: Expression outer commons grp schemas params from (null PGjsonb) -> Expression outer commons grp schemas params from (null PGjsonb) -> Expression outer commons grp schemas params from (null PGjsonb) #

sconcat :: NonEmpty (Expression outer commons grp schemas params from (null PGjsonb)) -> Expression outer commons grp schemas params from (null PGjsonb) #

stimes :: Integral b => b -> Expression outer commons grp schemas params from (null PGjsonb) -> Expression outer commons grp schemas params from (null PGjsonb) #

Semigroup (Expression outer commons grp schemas params from (null (PGvararray ty))) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(<>) :: Expression outer commons grp schemas params from (null (PGvararray ty)) -> Expression outer commons grp schemas params from (null (PGvararray ty)) -> Expression outer commons grp schemas params from (null (PGvararray ty)) #

sconcat :: NonEmpty (Expression outer commons grp schemas params from (null (PGvararray ty))) -> Expression outer commons grp schemas params from (null (PGvararray ty)) #

stimes :: Integral b => b -> Expression outer commons grp schemas params from (null (PGvararray ty)) -> Expression outer commons grp schemas params from (null (PGvararray ty)) #

Monoid (Expression outer commons grp schemas params from (null PGtsvector)) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

mempty :: Expression outer commons grp schemas params from (null PGtsvector) #

mappend :: Expression outer commons grp schemas params from (null PGtsvector) -> Expression outer commons grp schemas params from (null PGtsvector) -> Expression outer commons grp schemas params from (null PGtsvector) #

mconcat :: [Expression outer commons grp schemas params from (null PGtsvector)] -> Expression outer commons grp schemas params from (null PGtsvector) #

Monoid (Expression outer commons grp schemas params from (null PGtext)) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

mempty :: Expression outer commons grp schemas params from (null PGtext) #

mappend :: Expression outer commons grp schemas params from (null PGtext) -> Expression outer commons grp schemas params from (null PGtext) -> Expression outer commons grp schemas params from (null PGtext) #

mconcat :: [Expression outer commons grp schemas params from (null PGtext)] -> Expression outer commons grp schemas params from (null PGtext) #

NFData (Expression outer commons grp schemas params from ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

rnf :: Expression outer commons grp schemas params from ty -> () #

RenderSQL (Expression outer commons grp schemas params from ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

renderSQL :: Expression outer commons grp schemas params from ty -> ByteString Source #

type Rep (Expression outer commons grp schemas params from ty) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

type Rep (Expression outer commons grp schemas params from ty) = D1 (MetaData "Expression" "Squeal.PostgreSQL.Expression" "squeal-postgresql-0.5.2.0-4fAomBtpMjd6mRwLthA4w2" True) (C1 (MetaCons "UnsafeExpression" PrefixI True) (S1 (MetaSel (Just "renderExpression") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ByteString)))

type Expr x Source #

Arguments

 = Expression outer commons grp schemas params from x

cannot reference aliases

An Expr is a closed Expression. It is a FRankNType but don't be scared. Think of it as an expression which sees no namespaces, so you can't use parameters or alias references. It can be used as a simple piece of more complex Expressions.

type (:-->) x y Source #

Arguments

 = Expression outer commons grp schemas params from x

input

-> Expression outer commons grp schemas params from y

output

A RankNType for functions with a single argument. These could be either function calls or unary operators. This is a subtype of the usual Haskell function type ->, indeed a subcategory as it is closed under the usual . and id.

unsafeFunction :: ByteString -> x :--> y Source #

>>> printSQL $ unsafeFunction "f" true
f(TRUE)

unsafeUnaryOpL :: ByteString -> x :--> y Source #

>>> printSQL $ unsafeUnaryOpL "NOT" true
(NOT TRUE)

unsafeUnaryOpR :: ByteString -> x :--> y Source #

>>> printSQL $ true & unsafeUnaryOpR "IS NOT TRUE"
(TRUE IS NOT TRUE)

type Operator x1 x2 y Source #

Arguments

 = Expression outer commons grp schemas params from x1

left input

-> Expression outer commons grp schemas params from x2

right input

-> Expression outer commons grp schemas params from y

output

A RankNType for binary operators.

unsafeBinaryOp :: ByteString -> Operator ty0 ty1 ty2 Source #

>>> printSQL $ unsafeBinaryOp "OR" true false
(TRUE OR FALSE)

type FunctionVar x0 x1 y Source #

Arguments

 = [Expression outer commons grp schemas params from x0]

inputs

-> Expression outer commons grp schemas params from x1

must have at least 1 input

-> Expression outer commons grp schemas params from y

output

A RankNType for functions with a variable-length list of homogeneous arguments and at least 1 more argument.

unsafeFunctionVar :: ByteString -> FunctionVar x0 x1 y Source #

>>> printSQL (unsafeFunctionVar "greatest" [true, null_] false)
greatest(TRUE, NULL, FALSE)

type FunctionN xs y Source #

Arguments

 = NP (Expression outer commons grp schemas params from) xs

inputs

-> Expression outer commons grp schemas params from y

output

A RankNType for functions with a fixed-length list of heterogeneous arguments. Use the *: operator to end your argument lists, like so.

>>> printSQL (unsafeFunctionN "fun" (true :* false :* localTime *: true))
fun(TRUE, FALSE, LOCALTIME, TRUE)

unsafeFunctionN :: SListI xs => ByteString -> FunctionN xs y Source #

>>> printSQL $ unsafeFunctionN "f" (currentTime :* localTimestamp :* false *: literal 'a')
f(CURRENT_TIME, LOCALTIMESTAMP, FALSE, E'a')

class PGSubset container where Source #

Contained by operators

Minimal complete definition

Nothing

Methods

(@>) :: Operator (null0 container) (null1 container) (Null PGbool) Source #

(<@) :: Operator (null0 container) (null1 container) (Null PGbool) Source #

Instances
PGSubset PGjsonb Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(@>) :: Operator (null0 PGjsonb) (null1 PGjsonb) (Null PGbool) Source #

(<@) :: Operator (null0 PGjsonb) (null1 PGjsonb) (Null PGbool) Source #

PGSubset PGtsquery Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(@>) :: Operator (null0 PGtsquery) (null1 PGtsquery) (Null PGbool) Source #

(<@) :: Operator (null0 PGtsquery) (null1 PGtsquery) (Null PGbool) Source #

PGSubset (PGvararray ty :: PGType) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(@>) :: Operator (null0 (PGvararray ty)) (null1 (PGvararray ty)) (Null PGbool) Source #

(<@) :: Operator (null0 (PGvararray ty)) (null1 (PGvararray ty)) (Null PGbool) Source #

Re-export

(&) :: a -> (a -> b) -> b infixl 1 #

& is a reverse application operator. This provides notational convenience. Its precedence is one higher than that of the forward application operator $, which allows & to be nested in $.

>>> 5 & (+1) & show
"6"

Since: base-4.8.0.0

newtype K a (b :: k) :: forall k. Type -> k -> Type #

The constant type functor.

Like Constant, but kind-polymorphic in its second argument and with a shorter name.

Constructors

K a 
Instances
Eq2 (K :: Type -> Type -> Type)

Since: sop-core-0.2.4.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> K a c -> K b d -> Bool #

Ord2 (K :: Type -> Type -> Type)

Since: sop-core-0.2.4.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> K a c -> K b d -> Ordering #

Read2 (K :: Type -> Type -> Type)

Since: sop-core-0.2.4.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (K a b) #

liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [K a b] #

liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (K a b) #

liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [K a b] #

Show2 (K :: Type -> Type -> Type)

Since: sop-core-0.2.4.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> K a b -> ShowS #

liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [K a b] -> ShowS #

NFData2 (K :: Type -> Type -> Type)

Since: sop-core-0.2.5.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

liftRnf2 :: (a -> ()) -> (b -> ()) -> K a b -> () #

Functor (K a :: Type -> Type) 
Instance details

Defined in Data.SOP.BasicFunctors

Methods

fmap :: (a0 -> b) -> K a a0 -> K a b #

(<$) :: a0 -> K a b -> K a a0 #

Monoid a => Applicative (K a :: Type -> Type) 
Instance details

Defined in Data.SOP.BasicFunctors

Methods

pure :: a0 -> K a a0 #

(<*>) :: K a (a0 -> b) -> K a a0 -> K a b #

liftA2 :: (a0 -> b -> c) -> K a a0 -> K a b -> K a c #

(*>) :: K a a0 -> K a b -> K a b #

(<*) :: K a a0 -> K a b -> K a a0 #

Foldable (K a :: Type -> Type) 
Instance details

Defined in Data.SOP.BasicFunctors

Methods

fold :: Monoid m => K a m -> m #

foldMap :: Monoid m => (a0 -> m) -> K a a0 -> m #

foldr :: (a0 -> b -> b) -> b -> K a a0 -> b #

foldr' :: (a0 -> b -> b) -> b -> K a a0 -> b #

foldl :: (b -> a0 -> b) -> b -> K a a0 -> b #

foldl' :: (b -> a0 -> b) -> b -> K a a0 -> b #

foldr1 :: (a0 -> a0 -> a0) -> K a a0 -> a0 #

foldl1 :: (a0 -> a0 -> a0) -> K a a0 -> a0 #

toList :: K a a0 -> [a0] #

null :: K a a0 -> Bool #

length :: K a a0 -> Int #

elem :: Eq a0 => a0 -> K a a0 -> Bool #

maximum :: Ord a0 => K a a0 -> a0 #

minimum :: Ord a0 => K a a0 -> a0 #

sum :: Num a0 => K a a0 -> a0 #

product :: Num a0 => K a a0 -> a0 #

Traversable (K a :: Type -> Type) 
Instance details

Defined in Data.SOP.BasicFunctors

Methods

traverse :: Applicative f => (a0 -> f b) -> K a a0 -> f (K a b) #

sequenceA :: Applicative f => K a (f a0) -> f (K a a0) #

mapM :: Monad m => (a0 -> m b) -> K a a0 -> m (K a b) #

sequence :: Monad m => K a (m a0) -> m (K a a0) #

Eq a => Eq1 (K a :: Type -> Type)

Since: sop-core-0.2.4.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

liftEq :: (a0 -> b -> Bool) -> K a a0 -> K a b -> Bool #

Ord a => Ord1 (K a :: Type -> Type)

Since: sop-core-0.2.4.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

liftCompare :: (a0 -> b -> Ordering) -> K a a0 -> K a b -> Ordering #

Read a => Read1 (K a :: Type -> Type)

Since: sop-core-0.2.4.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (K a a0) #

liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [K a a0] #

liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (K a a0) #

liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [K a a0] #

Show a => Show1 (K a :: Type -> Type)

Since: sop-core-0.2.4.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> K a a0 -> ShowS #

liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [K a a0] -> ShowS #

NFData a => NFData1 (K a :: Type -> Type)

Since: sop-core-0.2.5.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

liftRnf :: (a0 -> ()) -> K a a0 -> () #

Eq a => Eq (K a b) 
Instance details

Defined in Data.SOP.BasicFunctors

Methods

(==) :: K a b -> K a b -> Bool #

(/=) :: K a b -> K a b -> Bool #

Ord a => Ord (K a b) 
Instance details

Defined in Data.SOP.BasicFunctors

Methods

compare :: K a b -> K a b -> Ordering #

(<) :: K a b -> K a b -> Bool #

(<=) :: K a b -> K a b -> Bool #

(>) :: K a b -> K a b -> Bool #

(>=) :: K a b -> K a b -> Bool #

max :: K a b -> K a b -> K a b #

min :: K a b -> K a b -> K a b #

Read a => Read (K a b) 
Instance details

Defined in Data.SOP.BasicFunctors

Methods

readsPrec :: Int -> ReadS (K a b) #

readList :: ReadS [K a b] #

readPrec :: ReadPrec (K a b) #

readListPrec :: ReadPrec [K a b] #

Show a => Show (K a b) 
Instance details

Defined in Data.SOP.BasicFunctors

Methods

showsPrec :: Int -> K a b -> ShowS #

show :: K a b -> String #

showList :: [K a b] -> ShowS #

Generic (K a b) 
Instance details

Defined in Data.SOP.BasicFunctors

Associated Types

type Rep (K a b) :: Type -> Type #

Methods

from :: K a b -> Rep (K a b) x #

to :: Rep (K a b) x -> K a b #

Semigroup a => Semigroup (K a b)

Since: sop-core-0.4.0.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

(<>) :: K a b -> K a b -> K a b #

sconcat :: NonEmpty (K a b) -> K a b #

stimes :: Integral b0 => b0 -> K a b -> K a b #

Monoid a => Monoid (K a b)

Since: sop-core-0.4.0.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

mempty :: K a b #

mappend :: K a b -> K a b -> K a b #

mconcat :: [K a b] -> K a b #

NFData a => NFData (K a b)

Since: sop-core-0.2.5.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

rnf :: K a b -> () #

type Rep (K a b) 
Instance details

Defined in Data.SOP.BasicFunctors

type Rep (K a b) = D1 (MetaData "K" "Data.SOP.BasicFunctors" "sop-core-0.4.0.0-F1xCWaFkXPd3dWDWBPXHJg" True) (C1 (MetaCons "K" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Code (K a b) 
Instance details

Defined in Generics.SOP.Instances

type Code (K a b) = (a ': ([] :: [Type])) ': ([] :: [[Type]])
type DatatypeInfoOf (K a b) 
Instance details

Defined in Generics.SOP.Instances

type DatatypeInfoOf (K a b) = Newtype "Data.SOP.BasicFunctors" "K" (Constructor "K")

unK :: K a b -> a #

Extract the contents of a K value.