Safe Haskell | None |
---|---|
Language | Haskell2010 |
Left, right, and full outer joins.
Opaleye.FunctionalJoin provides a much nicer, Haskelly, interface to joins than this module, which sticks to the (horrible) standard "make missing rows NULL" interface that SQL provides.
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)))
- leftJoin :: (Default Unpackspec columnsL columnsL, Default Unpackspec columnsR columnsR, Default NullMaker columnsR nullableColumnsR) => Query columnsL -> Query columnsR -> ((columnsL, columnsR) -> Column PGBool) -> Query (columnsL, nullableColumnsR)
- rightJoin :: (Default Unpackspec columnsL columnsL, Default Unpackspec columnsR columnsR, Default NullMaker columnsL nullableColumnsL) => Query columnsL -> Query columnsR -> ((columnsL, columnsR) -> Column PGBool) -> Query (nullableColumnsL, columnsR)
- fullJoin :: (Default Unpackspec columnsL columnsL, Default Unpackspec columnsR columnsR, Default NullMaker columnsL nullableColumnsL, Default NullMaker columnsR nullableColumnsR) => Query columnsL -> Query columnsR -> ((columnsL, columnsR) -> Column PGBool) -> Query (nullableColumnsL, nullableColumnsR)
- leftJoinExplicit :: Unpackspec columnsL columnsL -> Unpackspec columnsR columnsR -> NullMaker columnsR nullableColumnsR -> Query columnsL -> Query columnsR -> ((columnsL, columnsR) -> Column PGBool) -> Query (columnsL, nullableColumnsR)
- rightJoinExplicit :: Unpackspec columnsL columnsL -> Unpackspec columnsR columnsR -> NullMaker columnsL nullableColumnsL -> Query columnsL -> Query columnsR -> ((columnsL, columnsR) -> Column PGBool) -> Query (nullableColumnsL, columnsR)
- fullJoinExplicit :: Unpackspec columnsL columnsL -> Unpackspec columnsR columnsR -> NullMaker columnsL nullableColumnsL -> NullMaker columnsR nullableColumnsR -> Query columnsL -> Query columnsR -> ((columnsL, columnsR) -> Column PGBool) -> Query (nullableColumnsL, nullableColumnsR)
Joins
:: (Default Unpackspec columnsL columnsL, Default Unpackspec columnsR columnsR, Default NullMaker columnsL nullableColumnsL, Default NullMaker columnsR nullableColumnsR) | |
=> Query columnsL | Left query |
-> Query columnsR | Right query |
-> ((columnsL, columnsR) -> Column PGBool) | Condition on which to join |
-> Query (nullableColumnsL, nullableColumnsR) | Full outer join |
Explicit versions
leftJoinExplicit :: Unpackspec columnsL columnsL -> Unpackspec columnsR columnsR -> NullMaker columnsR nullableColumnsR -> Query columnsL -> Query columnsR -> ((columnsL, columnsR) -> Column PGBool) -> Query (columnsL, nullableColumnsR) Source #
rightJoinExplicit :: Unpackspec columnsL columnsL -> Unpackspec columnsR columnsR -> NullMaker columnsL nullableColumnsL -> Query columnsL -> Query columnsR -> ((columnsL, columnsR) -> Column PGBool) -> Query (nullableColumnsL, columnsR) Source #
fullJoinExplicit :: Unpackspec columnsL columnsL -> Unpackspec columnsR columnsR -> NullMaker columnsL nullableColumnsL -> NullMaker columnsR nullableColumnsR -> Query columnsL -> Query columnsR -> ((columnsL, columnsR) -> Column PGBool) -> Query (nullableColumnsL, nullableColumnsR) Source #