opaleye-0.5.1.1: An SQL-generating DSL targeting PostgreSQL

Safe HaskellNone
LanguageHaskell2010

Opaleye.Join

Description

Left, right, and full outer joins. If you want inner joins, just use restrict instead.

The use of the Default typeclass means that the compiler will have trouble inferring types. It is strongly recommended that you provide full type signatures when using the join functions.

Example specialization:

leftJoin :: Query (Column a, Column b)
         -> Query (Column c, Column (Nullable d))
         -> (((Column a, Column b), (Column c, Column (Nullable d))) -> Column PGBool)
         -> Query ((Column a, Column b), (Column (Nullable c), Column (Nullable d)))

Documentation

leftJoin Source #

Arguments

:: (Default Unpackspec columnsA columnsA, Default Unpackspec columnsB columnsB, Default NullMaker columnsB nullableColumnsB) 
=> Query columnsA

Left query

-> Query columnsB

Right query

-> ((columnsA, columnsB) -> Column PGBool)

Condition on which to join

-> Query (columnsA, nullableColumnsB)

Left join

rightJoin Source #

Arguments

:: (Default Unpackspec columnsA columnsA, Default Unpackspec columnsB columnsB, Default NullMaker columnsA nullableColumnsA) 
=> Query columnsA

Left query

-> Query columnsB

Right query

-> ((columnsA, columnsB) -> Column PGBool)

Condition on which to join

-> Query (nullableColumnsA, columnsB)

Right join

fullJoin Source #

Arguments

:: (Default Unpackspec columnsA columnsA, Default Unpackspec columnsB columnsB, Default NullMaker columnsA nullableColumnsA, Default NullMaker columnsB nullableColumnsB) 
=> Query columnsA

Left query

-> Query columnsB

Right query

-> ((columnsA, columnsB) -> Column PGBool)

Condition on which to join

-> Query (nullableColumnsA, nullableColumnsB)

Full outer join

leftJoinExplicit :: Unpackspec columnsA columnsA -> Unpackspec columnsB columnsB -> NullMaker columnsB nullableColumnsB -> Query columnsA -> Query columnsB -> ((columnsA, columnsB) -> Column PGBool) -> Query (columnsA, nullableColumnsB) Source #

rightJoinExplicit :: Unpackspec columnsA columnsA -> Unpackspec columnsB columnsB -> NullMaker columnsA nullableColumnsA -> Query columnsA -> Query columnsB -> ((columnsA, columnsB) -> Column PGBool) -> Query (nullableColumnsA, columnsB) Source #

fullJoinExplicit :: Unpackspec columnsA columnsA -> Unpackspec columnsB columnsB -> NullMaker columnsA nullableColumnsA -> NullMaker columnsB nullableColumnsB -> Query columnsA -> Query columnsB -> ((columnsA, columnsB) -> Column PGBool) -> Query (nullableColumnsA, nullableColumnsB) Source #