{-# LANGUAGE
ConstraintKinds
, DeriveGeneric
, DerivingStrategies
, FlexibleContexts
, FlexibleInstances
, GADTs
, GeneralizedNewtypeDeriving
, LambdaCase
, MultiParamTypeClasses
, OverloadedLabels
, OverloadedStrings
, QuantifiedConstraints
, ScopedTypeVariables
, StandaloneDeriving
, TypeApplications
, TypeFamilies
, TypeInType
, TypeOperators
, RankNTypes
, UndecidableInstances
#-}
module Squeal.PostgreSQL.Query.From.Join
(
JoinItem (..)
, cross, crossJoin, crossJoinLateral
, inner, innerJoin, innerJoinLateral
, leftOuter, leftOuterJoin, leftOuterJoinLateral
, rightOuter, rightOuterJoin, rightOuterJoinLateral
, fullOuter, fullOuterJoin, fullOuterJoinLateral
) where
import Generics.SOP hiding (from)
import qualified Generics.SOP as SOP
import Squeal.PostgreSQL.Type.Alias
import Squeal.PostgreSQL.Expression
import Squeal.PostgreSQL.Expression.Logic
import Squeal.PostgreSQL.Query
import Squeal.PostgreSQL.Query.From
import Squeal.PostgreSQL.Query.From.Set
import Squeal.PostgreSQL.Render
import Squeal.PostgreSQL.Type.List
import Squeal.PostgreSQL.Type.Schema
data JoinItem
(lat :: FromType)
(with :: FromType)
(db :: SchemasType)
(params :: [NullType])
(left :: FromType)
(right :: FromType) where
Join
:: FromClause lat with db params right
-> JoinItem lat with db params left right
JoinLateral
:: Aliased (Query (Join lat left) with db params) query
-> JoinItem lat with db params left '[query]
JoinFunction
:: SetFun db arg set
-> Expression 'Ungrouped lat with db params left arg
-> JoinItem lat with db params left '[set]
JoinFunctionN
:: SListI args
=> SetFunN db args set
-> NP (Expression 'Ungrouped lat with db params left) args
-> JoinItem lat with db params left '[set]
instance RenderSQL (JoinItem lat with db params left right) where
renderSQL :: JoinItem lat with db params left right -> ByteString
renderSQL = \case
Join FromClause lat with db params right
tab -> ByteString
"JOIN" ByteString -> ByteString -> ByteString
<+> FromClause lat with db params right -> ByteString
forall sql. RenderSQL sql => sql -> ByteString
renderSQL FromClause lat with db params right
tab
JoinLateral Aliased (Query (Join lat left) with db params) query
qry -> ByteString
"JOIN LATERAL" ByteString -> ByteString -> ByteString
<+>
(forall (ty :: RowType).
Query (Join lat left) with db params ty -> ByteString)
-> Aliased (Query (Join lat left) with db params) query
-> ByteString
forall k (expression :: k -> *) (aliased :: (Symbol, k)).
(forall (ty :: k). expression ty -> ByteString)
-> Aliased expression aliased -> ByteString
renderAliased (ByteString -> ByteString
parenthesized (ByteString -> ByteString)
-> (Query (Join lat left) with db params ty -> ByteString)
-> Query (Join lat left) with db params ty
-> ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Query (Join lat left) with db params ty -> ByteString
forall sql. RenderSQL sql => sql -> ByteString
renderSQL) Aliased (Query (Join lat left) with db params) query
qry
JoinFunction SetFun db arg set
fun Expression 'Ungrouped lat with db params left arg
x -> ByteString
"JOIN" ByteString -> ByteString -> ByteString
<+>
FromClause Any Any db Any '[set] -> ByteString
forall sql. RenderSQL sql => sql -> ByteString
renderSQL (Expression 'Ungrouped Any Any db Any '[] arg
-> FromClause Any Any db Any '[set]
SetFun db arg set
fun (ByteString -> Expression 'Ungrouped Any Any db Any '[] arg
forall (grp :: Grouping) (lat :: FromType) (with :: FromType)
(db :: SchemasType) (params :: [NullType]) (from :: FromType)
(ty :: NullType).
ByteString -> Expression grp lat with db params from ty
UnsafeExpression (Expression 'Ungrouped lat with db params left arg -> ByteString
forall sql. RenderSQL sql => sql -> ByteString
renderSQL Expression 'Ungrouped lat with db params left arg
x)))
JoinFunctionN SetFunN db args set
fun NP (Expression 'Ungrouped lat with db params left) args
xs -> ByteString
"JOIN" ByteString -> ByteString -> ByteString
<+>
FromClause Any Any db Any '[set] -> ByteString
forall sql. RenderSQL sql => sql -> ByteString
renderSQL (NP (Expression 'Ungrouped Any Any db Any '[]) args
-> FromClause Any Any db Any '[set]
SetFunN db args set
fun ((forall (a :: NullType).
Expression 'Ungrouped lat with db params left a
-> Expression 'Ungrouped Any Any db Any '[] a)
-> NP (Expression 'Ungrouped lat with db params left) args
-> NP (Expression 'Ungrouped Any Any db Any '[]) args
forall k l (h :: (k -> *) -> l -> *) (xs :: l) (f :: k -> *)
(f' :: k -> *).
(SListIN (Prod h) xs, HAp h) =>
(forall (a :: k). f a -> f' a) -> h f xs -> h f' xs
SOP.hmap (ByteString -> Expression 'Ungrouped Any Any db Any '[] a
forall (grp :: Grouping) (lat :: FromType) (with :: FromType)
(db :: SchemasType) (params :: [NullType]) (from :: FromType)
(ty :: NullType).
ByteString -> Expression grp lat with db params from ty
UnsafeExpression (ByteString -> Expression 'Ungrouped Any Any db Any '[] a)
-> (Expression 'Ungrouped lat with db params left a -> ByteString)
-> Expression 'Ungrouped lat with db params left a
-> Expression 'Ungrouped Any Any db Any '[] a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Expression 'Ungrouped lat with db params left a -> ByteString
forall sql. RenderSQL sql => sql -> ByteString
renderSQL) NP (Expression 'Ungrouped lat with db params left) args
xs))
cross
:: JoinItem lat with db params left right
-> FromClause lat with db params left
-> FromClause lat with db params (Join left right)
cross :: JoinItem lat with db params left right
-> FromClause lat with db params left
-> FromClause lat with db params (Join left right)
cross JoinItem lat with db params left right
item FromClause lat with db params left
tab = ByteString -> FromClause lat with db params (Join left right)
forall (lat :: FromType) (with :: FromType) (db :: SchemasType)
(params :: [NullType]) (from :: FromType).
ByteString -> FromClause lat with db params from
UnsafeFromClause (ByteString -> FromClause lat with db params (Join left right))
-> ByteString -> FromClause lat with db params (Join left right)
forall a b. (a -> b) -> a -> b
$
FromClause lat with db params left -> ByteString
forall sql. RenderSQL sql => sql -> ByteString
renderSQL FromClause lat with db params left
tab ByteString -> ByteString -> ByteString
<+> ByteString
"CROSS" ByteString -> ByteString -> ByteString
<+> JoinItem lat with db params left right -> ByteString
forall sql. RenderSQL sql => sql -> ByteString
renderSQL JoinItem lat with db params left right
item
crossJoin
:: FromClause lat with db params right
-> FromClause lat with db params left
-> FromClause lat with db params (Join left right)
crossJoin :: FromClause lat with db params right
-> FromClause lat with db params left
-> FromClause lat with db params (Join left right)
crossJoin = JoinItem lat with db params left right
-> FromClause lat with db params left
-> FromClause lat with db params (Join left right)
forall (lat :: FromType) (with :: FromType) (db :: SchemasType)
(params :: [NullType]) (left :: FromType) (right :: FromType).
JoinItem lat with db params left right
-> FromClause lat with db params left
-> FromClause lat with db params (Join left right)
cross (JoinItem lat with db params left right
-> FromClause lat with db params left
-> FromClause lat with db params (Join left right))
-> (FromClause lat with db params right
-> JoinItem lat with db params left right)
-> FromClause lat with db params right
-> FromClause lat with db params left
-> FromClause lat with db params (Join left right)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FromClause lat with db params right
-> JoinItem lat with db params left right
forall (lat :: FromType) (with :: FromType) (db :: SchemasType)
(params :: [NullType]) (right :: FromType) (left :: FromType).
FromClause lat with db params right
-> JoinItem lat with db params left right
Join
crossJoinLateral
:: Aliased (Query (Join lat left) with db params) query
-> FromClause lat with db params left
-> FromClause lat with db params (Join left '[query])
crossJoinLateral :: Aliased (Query (Join lat left) with db params) query
-> FromClause lat with db params left
-> FromClause lat with db params (Join left '[query])
crossJoinLateral = JoinItem lat with db params left '[query]
-> FromClause lat with db params left
-> FromClause lat with db params (Join left '[query])
forall (lat :: FromType) (with :: FromType) (db :: SchemasType)
(params :: [NullType]) (left :: FromType) (right :: FromType).
JoinItem lat with db params left right
-> FromClause lat with db params left
-> FromClause lat with db params (Join left right)
cross (JoinItem lat with db params left '[query]
-> FromClause lat with db params left
-> FromClause lat with db params (Join left '[query]))
-> (Aliased (Query (Join lat left) with db params) query
-> JoinItem lat with db params left '[query])
-> Aliased (Query (Join lat left) with db params) query
-> FromClause lat with db params left
-> FromClause lat with db params (Join left '[query])
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Aliased (Query (Join lat left) with db params) query
-> JoinItem lat with db params left '[query]
forall (lat :: FromType) (left :: FromType) (with :: FromType)
(db :: SchemasType) (params :: [NullType])
(query :: (Symbol, RowType)).
Aliased (Query (Join lat left) with db params) query
-> JoinItem lat with db params left '[query]
JoinLateral
inner
:: JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join left right)
inner :: JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join left right)
inner JoinItem lat with db params left right
item Condition 'Ungrouped lat with db params (Join left right)
on FromClause lat with db params left
tab = ByteString -> FromClause lat with db params (Join left right)
forall (lat :: FromType) (with :: FromType) (db :: SchemasType)
(params :: [NullType]) (from :: FromType).
ByteString -> FromClause lat with db params from
UnsafeFromClause (ByteString -> FromClause lat with db params (Join left right))
-> ByteString -> FromClause lat with db params (Join left right)
forall a b. (a -> b) -> a -> b
$
FromClause lat with db params left -> ByteString
forall sql. RenderSQL sql => sql -> ByteString
renderSQL FromClause lat with db params left
tab ByteString -> ByteString -> ByteString
<+> ByteString
"INNER" ByteString -> ByteString -> ByteString
<+> JoinItem lat with db params left right -> ByteString
forall sql. RenderSQL sql => sql -> ByteString
renderSQL JoinItem lat with db params left right
item ByteString -> ByteString -> ByteString
<+> ByteString
"ON" ByteString -> ByteString -> ByteString
<+> Condition 'Ungrouped lat with db params (Join left right)
-> ByteString
forall sql. RenderSQL sql => sql -> ByteString
renderSQL Condition 'Ungrouped lat with db params (Join left right)
on
innerJoin
:: FromClause lat with db params right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join left right)
innerJoin :: FromClause lat with db params right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join left right)
innerJoin = JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join left right)
forall (lat :: FromType) (with :: FromType) (db :: SchemasType)
(params :: [NullType]) (left :: FromType) (right :: FromType).
JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join left right)
inner (JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join left right))
-> (FromClause lat with db params right
-> JoinItem lat with db params left right)
-> FromClause lat with db params right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join left right)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FromClause lat with db params right
-> JoinItem lat with db params left right
forall (lat :: FromType) (with :: FromType) (db :: SchemasType)
(params :: [NullType]) (right :: FromType) (left :: FromType).
FromClause lat with db params right
-> JoinItem lat with db params left right
Join
innerJoinLateral
:: Aliased (Query (Join lat left) with db params) query
-> Condition 'Ungrouped lat with db params (Join left '[query])
-> FromClause lat with db params left
-> FromClause lat with db params (Join left '[query])
innerJoinLateral :: Aliased (Query (Join lat left) with db params) query
-> Condition 'Ungrouped lat with db params (Join left '[query])
-> FromClause lat with db params left
-> FromClause lat with db params (Join left '[query])
innerJoinLateral = JoinItem lat with db params left '[query]
-> Condition 'Ungrouped lat with db params (Join left '[query])
-> FromClause lat with db params left
-> FromClause lat with db params (Join left '[query])
forall (lat :: FromType) (with :: FromType) (db :: SchemasType)
(params :: [NullType]) (left :: FromType) (right :: FromType).
JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join left right)
inner (JoinItem lat with db params left '[query]
-> Condition 'Ungrouped lat with db params (Join left '[query])
-> FromClause lat with db params left
-> FromClause lat with db params (Join left '[query]))
-> (Aliased (Query (Join lat left) with db params) query
-> JoinItem lat with db params left '[query])
-> Aliased (Query (Join lat left) with db params) query
-> Condition 'Ungrouped lat with db params (Join left '[query])
-> FromClause lat with db params left
-> FromClause lat with db params (Join left '[query])
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Aliased (Query (Join lat left) with db params) query
-> JoinItem lat with db params left '[query]
forall (lat :: FromType) (left :: FromType) (with :: FromType)
(db :: SchemasType) (params :: [NullType])
(query :: (Symbol, RowType)).
Aliased (Query (Join lat left) with db params) query
-> JoinItem lat with db params left '[query]
JoinLateral
leftOuter
:: JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join left (NullifyFrom right))
leftOuter :: JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join left (NullifyFrom right))
leftOuter JoinItem lat with db params left right
item Condition 'Ungrouped lat with db params (Join left right)
on FromClause lat with db params left
tab = ByteString
-> FromClause lat with db params (Join left (NullifyFrom right))
forall (lat :: FromType) (with :: FromType) (db :: SchemasType)
(params :: [NullType]) (from :: FromType).
ByteString -> FromClause lat with db params from
UnsafeFromClause (ByteString
-> FromClause lat with db params (Join left (NullifyFrom right)))
-> ByteString
-> FromClause lat with db params (Join left (NullifyFrom right))
forall a b. (a -> b) -> a -> b
$
FromClause lat with db params left -> ByteString
forall sql. RenderSQL sql => sql -> ByteString
renderSQL FromClause lat with db params left
tab ByteString -> ByteString -> ByteString
<+> ByteString
"LEFT OUTER" ByteString -> ByteString -> ByteString
<+> JoinItem lat with db params left right -> ByteString
forall sql. RenderSQL sql => sql -> ByteString
renderSQL JoinItem lat with db params left right
item ByteString -> ByteString -> ByteString
<+> ByteString
"ON" ByteString -> ByteString -> ByteString
<+> Condition 'Ungrouped lat with db params (Join left right)
-> ByteString
forall sql. RenderSQL sql => sql -> ByteString
renderSQL Condition 'Ungrouped lat with db params (Join left right)
on
leftOuterJoin
:: FromClause lat with db params right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join left (NullifyFrom right))
leftOuterJoin :: FromClause lat with db params right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join left (NullifyFrom right))
leftOuterJoin = JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join left (NullifyFrom right))
forall (lat :: FromType) (with :: FromType) (db :: SchemasType)
(params :: [NullType]) (left :: FromType) (right :: FromType).
JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join left (NullifyFrom right))
leftOuter (JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join left (NullifyFrom right)))
-> (FromClause lat with db params right
-> JoinItem lat with db params left right)
-> FromClause lat with db params right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join left (NullifyFrom right))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FromClause lat with db params right
-> JoinItem lat with db params left right
forall (lat :: FromType) (with :: FromType) (db :: SchemasType)
(params :: [NullType]) (right :: FromType) (left :: FromType).
FromClause lat with db params right
-> JoinItem lat with db params left right
Join
leftOuterJoinLateral
:: Aliased (Query (Join lat left) with db params) query
-> Condition 'Ungrouped lat with db params (Join left '[query])
-> FromClause lat with db params left
-> FromClause lat with db params (Join left (NullifyFrom '[query]))
leftOuterJoinLateral :: Aliased (Query (Join lat left) with db params) query
-> Condition 'Ungrouped lat with db params (Join left '[query])
-> FromClause lat with db params left
-> FromClause lat with db params (Join left (NullifyFrom '[query]))
leftOuterJoinLateral = JoinItem lat with db params left '[query]
-> Condition 'Ungrouped lat with db params (Join left '[query])
-> FromClause lat with db params left
-> FromClause lat with db params (Join left (NullifyFrom '[query]))
forall (lat :: FromType) (with :: FromType) (db :: SchemasType)
(params :: [NullType]) (left :: FromType) (right :: FromType).
JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join left (NullifyFrom right))
leftOuter (JoinItem lat with db params left '[query]
-> Condition 'Ungrouped lat with db params (Join left '[query])
-> FromClause lat with db params left
-> FromClause
lat with db params (Join left (NullifyFrom '[query])))
-> (Aliased (Query (Join lat left) with db params) query
-> JoinItem lat with db params left '[query])
-> Aliased (Query (Join lat left) with db params) query
-> Condition 'Ungrouped lat with db params (Join left '[query])
-> FromClause lat with db params left
-> FromClause lat with db params (Join left (NullifyFrom '[query]))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Aliased (Query (Join lat left) with db params) query
-> JoinItem lat with db params left '[query]
forall (lat :: FromType) (left :: FromType) (with :: FromType)
(db :: SchemasType) (params :: [NullType])
(query :: (Symbol, RowType)).
Aliased (Query (Join lat left) with db params) query
-> JoinItem lat with db params left '[query]
JoinLateral
rightOuter
:: JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join (NullifyFrom left) right)
rightOuter :: JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join (NullifyFrom left) right)
rightOuter JoinItem lat with db params left right
item Condition 'Ungrouped lat with db params (Join left right)
on FromClause lat with db params left
tab = ByteString
-> FromClause lat with db params (Join (NullifyFrom left) right)
forall (lat :: FromType) (with :: FromType) (db :: SchemasType)
(params :: [NullType]) (from :: FromType).
ByteString -> FromClause lat with db params from
UnsafeFromClause (ByteString
-> FromClause lat with db params (Join (NullifyFrom left) right))
-> ByteString
-> FromClause lat with db params (Join (NullifyFrom left) right)
forall a b. (a -> b) -> a -> b
$
FromClause lat with db params left -> ByteString
forall sql. RenderSQL sql => sql -> ByteString
renderSQL FromClause lat with db params left
tab ByteString -> ByteString -> ByteString
<+> ByteString
"RIGHT OUTER" ByteString -> ByteString -> ByteString
<+> JoinItem lat with db params left right -> ByteString
forall sql. RenderSQL sql => sql -> ByteString
renderSQL JoinItem lat with db params left right
item ByteString -> ByteString -> ByteString
<+> ByteString
"ON" ByteString -> ByteString -> ByteString
<+> Condition 'Ungrouped lat with db params (Join left right)
-> ByteString
forall sql. RenderSQL sql => sql -> ByteString
renderSQL Condition 'Ungrouped lat with db params (Join left right)
on
rightOuterJoin
:: FromClause lat with db params right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join (NullifyFrom left) right)
rightOuterJoin :: FromClause lat with db params right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join (NullifyFrom left) right)
rightOuterJoin = JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join (NullifyFrom left) right)
forall (lat :: FromType) (with :: FromType) (db :: SchemasType)
(params :: [NullType]) (left :: FromType) (right :: FromType).
JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join (NullifyFrom left) right)
rightOuter (JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join (NullifyFrom left) right))
-> (FromClause lat with db params right
-> JoinItem lat with db params left right)
-> FromClause lat with db params right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join (NullifyFrom left) right)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FromClause lat with db params right
-> JoinItem lat with db params left right
forall (lat :: FromType) (with :: FromType) (db :: SchemasType)
(params :: [NullType]) (right :: FromType) (left :: FromType).
FromClause lat with db params right
-> JoinItem lat with db params left right
Join
rightOuterJoinLateral
:: Aliased (Query (Join lat left) with db params) query
-> Condition 'Ungrouped lat with db params (Join left '[query])
-> FromClause lat with db params left
-> FromClause lat with db params (Join (NullifyFrom left) '[query])
rightOuterJoinLateral :: Aliased (Query (Join lat left) with db params) query
-> Condition 'Ungrouped lat with db params (Join left '[query])
-> FromClause lat with db params left
-> FromClause lat with db params (Join (NullifyFrom left) '[query])
rightOuterJoinLateral = JoinItem lat with db params left '[query]
-> Condition 'Ungrouped lat with db params (Join left '[query])
-> FromClause lat with db params left
-> FromClause lat with db params (Join (NullifyFrom left) '[query])
forall (lat :: FromType) (with :: FromType) (db :: SchemasType)
(params :: [NullType]) (left :: FromType) (right :: FromType).
JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (Join (NullifyFrom left) right)
rightOuter (JoinItem lat with db params left '[query]
-> Condition 'Ungrouped lat with db params (Join left '[query])
-> FromClause lat with db params left
-> FromClause
lat with db params (Join (NullifyFrom left) '[query]))
-> (Aliased (Query (Join lat left) with db params) query
-> JoinItem lat with db params left '[query])
-> Aliased (Query (Join lat left) with db params) query
-> Condition 'Ungrouped lat with db params (Join left '[query])
-> FromClause lat with db params left
-> FromClause lat with db params (Join (NullifyFrom left) '[query])
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Aliased (Query (Join lat left) with db params) query
-> JoinItem lat with db params left '[query]
forall (lat :: FromType) (left :: FromType) (with :: FromType)
(db :: SchemasType) (params :: [NullType])
(query :: (Symbol, RowType)).
Aliased (Query (Join lat left) with db params) query
-> JoinItem lat with db params left '[query]
JoinLateral
fullOuter
:: JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (NullifyFrom (Join left right))
fullOuter :: JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (NullifyFrom (Join left right))
fullOuter JoinItem lat with db params left right
item Condition 'Ungrouped lat with db params (Join left right)
on FromClause lat with db params left
tab = ByteString
-> FromClause lat with db params (NullifyFrom (Join left right))
forall (lat :: FromType) (with :: FromType) (db :: SchemasType)
(params :: [NullType]) (from :: FromType).
ByteString -> FromClause lat with db params from
UnsafeFromClause (ByteString
-> FromClause lat with db params (NullifyFrom (Join left right)))
-> ByteString
-> FromClause lat with db params (NullifyFrom (Join left right))
forall a b. (a -> b) -> a -> b
$
FromClause lat with db params left -> ByteString
forall sql. RenderSQL sql => sql -> ByteString
renderSQL FromClause lat with db params left
tab ByteString -> ByteString -> ByteString
<+> ByteString
"FULL OUTER" ByteString -> ByteString -> ByteString
<+> JoinItem lat with db params left right -> ByteString
forall sql. RenderSQL sql => sql -> ByteString
renderSQL JoinItem lat with db params left right
item ByteString -> ByteString -> ByteString
<+> ByteString
"ON" ByteString -> ByteString -> ByteString
<+> Condition 'Ungrouped lat with db params (Join left right)
-> ByteString
forall sql. RenderSQL sql => sql -> ByteString
renderSQL Condition 'Ungrouped lat with db params (Join left right)
on
fullOuterJoin
:: FromClause lat with db params right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (NullifyFrom (Join left right))
fullOuterJoin :: FromClause lat with db params right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (NullifyFrom (Join left right))
fullOuterJoin = JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (NullifyFrom (Join left right))
forall (lat :: FromType) (with :: FromType) (db :: SchemasType)
(params :: [NullType]) (left :: FromType) (right :: FromType).
JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (NullifyFrom (Join left right))
fullOuter (JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (NullifyFrom (Join left right)))
-> (FromClause lat with db params right
-> JoinItem lat with db params left right)
-> FromClause lat with db params right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (NullifyFrom (Join left right))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FromClause lat with db params right
-> JoinItem lat with db params left right
forall (lat :: FromType) (with :: FromType) (db :: SchemasType)
(params :: [NullType]) (right :: FromType) (left :: FromType).
FromClause lat with db params right
-> JoinItem lat with db params left right
Join
fullOuterJoinLateral
:: Aliased (Query (Join lat left) with db params) query
-> Condition 'Ungrouped lat with db params (Join left '[query])
-> FromClause lat with db params left
-> FromClause lat with db params (NullifyFrom (Join left '[query]))
fullOuterJoinLateral :: Aliased (Query (Join lat left) with db params) query
-> Condition 'Ungrouped lat with db params (Join left '[query])
-> FromClause lat with db params left
-> FromClause lat with db params (NullifyFrom (Join left '[query]))
fullOuterJoinLateral = JoinItem lat with db params left '[query]
-> Condition 'Ungrouped lat with db params (Join left '[query])
-> FromClause lat with db params left
-> FromClause lat with db params (NullifyFrom (Join left '[query]))
forall (lat :: FromType) (with :: FromType) (db :: SchemasType)
(params :: [NullType]) (left :: FromType) (right :: FromType).
JoinItem lat with db params left right
-> Condition 'Ungrouped lat with db params (Join left right)
-> FromClause lat with db params left
-> FromClause lat with db params (NullifyFrom (Join left right))
fullOuter (JoinItem lat with db params left '[query]
-> Condition 'Ungrouped lat with db params (Join left '[query])
-> FromClause lat with db params left
-> FromClause
lat with db params (NullifyFrom (Join left '[query])))
-> (Aliased (Query (Join lat left) with db params) query
-> JoinItem lat with db params left '[query])
-> Aliased (Query (Join lat left) with db params) query
-> Condition 'Ungrouped lat with db params (Join left '[query])
-> FromClause lat with db params left
-> FromClause lat with db params (NullifyFrom (Join left '[query]))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Aliased (Query (Join lat left) with db params) query
-> JoinItem lat with db params left '[query]
forall (lat :: FromType) (left :: FromType) (with :: FromType)
(db :: SchemasType) (params :: [NullType])
(query :: (Symbol, RowType)).
Aliased (Query (Join lat left) with db params) query
-> JoinItem lat with db params left '[query]
JoinLateral