squeal-postgresql-0.9.0.0: Squeal PostgreSQL Library
Copyright(c) Eitan Chatav 2019
Maintainereitan@morphism.tech
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Squeal.PostgreSQL.Query.From.Join

Contents

Description

Squeal joins

Synopsis

Join

data JoinItem (lat :: FromType) (with :: FromType) (db :: SchemasType) (params :: [NullType]) (left :: FromType) (right :: FromType) where Source #

A JoinItem is the right hand side of a cross, inner, leftOuter, rightOuter, fullOuter join of FromClauses.

Constructors

Join 

Fields

  • :: FromClause lat with db params right

    A standard Join. It is not allowed to reference columns provided by preceding FromClause items.

  • -> JoinItem lat with db params left right
     
JoinLateral 

Fields

JoinFunction 

Fields

JoinFunctionN 

Fields

Instances

Instances details
RenderSQL (JoinItem lat with db params left right) Source # 
Instance details

Defined in Squeal.PostgreSQL.Query.From.Join

Methods

renderSQL :: JoinItem lat with db params left right -> ByteString Source #

cross Source #

Arguments

:: JoinItem lat with db params left right

right

-> FromClause lat with db params left

left

-> FromClause lat with db params (Join left right) 

left & cross (Join right). For every possible combination of rows from left and right (i.e., a Cartesian product), the joined table will contain a row consisting of all columns in left followed by all columns in right. If the tables have n and m rows respectively, the joined table will have n * m rows.

crossJoin Source #

Arguments

:: FromClause lat with db params right

right

-> FromClause lat with db params left

left

-> FromClause lat with db params (Join left right) 

left & crossJoin right. For every possible combination of rows from left and right (i.e., a Cartesian product), the joined table will contain a row consisting of all columns in left followed by all columns in right. If the tables have n and m rows respectively, the joined table will have n * m rows.

crossJoinLateral Source #

Arguments

:: Aliased (Query (Join lat left) with db params) query

right subquery

-> FromClause lat with db params left

left

-> FromClause lat with db params (Join left '[query]) 

Like crossJoin with a subquery but allowed to reference columns provided by preceding FromClause items.

inner Source #

Arguments

:: JoinItem lat with db params left right

right

-> Condition 'Ungrouped lat with db params (Join left right)

ON condition

-> FromClause lat with db params left

left

-> FromClause lat with db params (Join left right) 

left & inner (Join right) on. The joined table is filtered by the on condition.

innerJoin Source #

Arguments

:: FromClause lat with db params right

right

-> Condition 'Ungrouped lat with db params (Join left right)

ON condition

-> FromClause lat with db params left

left

-> FromClause lat with db params (Join left right) 

left & innerJoin right on. The joined table is filtered by the on condition.

innerJoinLateral Source #

Arguments

:: Aliased (Query (Join lat left) with db params) query

right subquery

-> Condition 'Ungrouped lat with db params (Join left '[query])

ON condition

-> FromClause lat with db params left

left

-> FromClause lat with db params (Join left '[query]) 

Like innerJoin with a subquery but allowed to reference columns provided by preceding FromClause items.

leftOuter Source #

Arguments

:: JoinItem lat with db params left right

right

-> Condition 'Ungrouped lat with db params (Join left right)

ON condition

-> FromClause lat with db params left

left

-> FromClause lat with db params (Join left (NullifyFrom right)) 

left & leftOuter (Join right) on. First, an inner join is performed. Then, for each row in left that does not satisfy the on condition with any row in right, a joined row is added with null values in columns of right. Thus, the joined table always has at least one row for each row in left.

leftOuterJoin Source #

Arguments

:: FromClause lat with db params right

right

-> Condition 'Ungrouped lat with db params (Join left right)

ON condition

-> FromClause lat with db params left

left

-> FromClause lat with db params (Join left (NullifyFrom right)) 

left & leftOuterJoin right on. First, an inner join is performed. Then, for each row in left that does not satisfy the on condition with any row in right, a joined row is added with null values in columns of right. Thus, the joined table always has at least one row for each row in left.

leftOuterJoinLateral Source #

Arguments

:: Aliased (Query (Join lat left) with db params) query

right subquery

-> Condition 'Ungrouped lat with db params (Join left '[query])

ON condition

-> FromClause lat with db params left

left

-> FromClause lat with db params (Join left (NullifyFrom '[query])) 

Like leftOuterJoin with a subquery but allowed to reference columns provided by preceding FromClause items.

rightOuter Source #

Arguments

:: JoinItem lat with db params left right

right

-> Condition 'Ungrouped lat with db params (Join left right)

ON condition

-> FromClause lat with db params left

left

-> FromClause lat with db params (Join (NullifyFrom left) right) 

left & rightOuter (Join right) on. First, an inner join is performed. Then, for each row in right that does not satisfy the on condition with any row in left, a joined row is added with null values in columns of left. This is the converse of a left join: the result table will always have a row for each row in right.

rightOuterJoin Source #

Arguments

:: FromClause lat with db params right

right

-> Condition 'Ungrouped lat with db params (Join left right)

ON condition

-> FromClause lat with db params left

left

-> FromClause lat with db params (Join (NullifyFrom left) right) 

left & rightOuterJoin right on. First, an inner join is performed. Then, for each row in right that does not satisfy the on condition with any row in left, a joined row is added with null values in columns of left. This is the converse of a left join: the result table will always have a row for each row in right.

rightOuterJoinLateral Source #

Arguments

:: Aliased (Query (Join lat left) with db params) query

right subquery

-> Condition 'Ungrouped lat with db params (Join left '[query])

ON condition

-> FromClause lat with db params left

left

-> FromClause lat with db params (Join (NullifyFrom left) '[query]) 

Like rightOuterJoin with a subquery but allowed to reference columns provided by preceding FromClause items.

fullOuter Source #

Arguments

:: JoinItem lat with db params left right

right

-> Condition 'Ungrouped lat with db params (Join left right)

ON condition

-> FromClause lat with db params left

left

-> FromClause lat with db params (NullifyFrom (Join left right)) 

left & fullOuter (Join right) on. First, an inner join is performed. Then, for each row in left that does not satisfy the on condition with any row in right, a joined row is added with null values in columns of right. Also, for each row of right that does not satisfy the join condition with any row in left, a joined row with null values in the columns of left is added.

fullOuterJoin Source #

Arguments

:: FromClause lat with db params right

right

-> Condition 'Ungrouped lat with db params (Join left right)

ON condition

-> FromClause lat with db params left

left

-> FromClause lat with db params (NullifyFrom (Join left right)) 

left & fullOuterJoin right on. First, an inner join is performed. Then, for each row in left that does not satisfy the on condition with any row in right, a joined row is added with null values in columns of right. Also, for each row of right that does not satisfy the join condition with any row in left, a joined row with null values in the columns of left is added.

fullOuterJoinLateral Source #

Arguments

:: Aliased (Query (Join lat left) with db params) query

right subquery

-> Condition 'Ungrouped lat with db params (Join left '[query])

ON condition

-> FromClause lat with db params left

left

-> FromClause lat with db params (NullifyFrom (Join left '[query])) 

Like fullOuterJoin with a subquery but allowed to reference columns provided by preceding FromClause items.