relational-query-0.11.2.0: Typeful, Modular, Relational, algebraic query engine

Copyright2013-2017 Kei Hibino
LicenseBSD3
Maintainerex8k.hibino@gmail.com
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Database.Relational.Set

Contents

Description

This module defines set operations on monadic Relation operations.

Synopsis

Direct style join

type JoinRestriction a b = Record Flat a -> Record Flat b -> Predicate Flat Source #

Restriction predicate function type for direct style join operator, used on predicates of direct join style as follows.

  do xy <- query $
           relX inner relY on' [ x y -> ... ] -- this lambda form has JoinRestriction type
     ...

inner' infixl 8 Source #

Arguments

:: Relation pa a

Left query to join

-> Relation pb b

Right query to join

-> [JoinRestriction a b]

Join restrictions

-> Relation (pa, pb) (a, b)

Result joined relation

Direct inner join with place-holder parameters.

left' infixl 8 Source #

Arguments

:: Relation pa a

Left query to join

-> Relation pb b

Right query to join

-> [JoinRestriction a (Maybe b)]

Join restrictions

-> Relation (pa, pb) (a, Maybe b)

Result joined relation

Direct left outer join with place-holder parameters.

right' infixl 8 Source #

Arguments

:: Relation pa a

Left query to join

-> Relation pb b

Right query to join

-> [JoinRestriction (Maybe a) b]

Join restrictions

-> Relation (pa, pb) (Maybe a, b)

Result joined relation

Direct right outer join with place-holder parameters.

full' infixl 8 Source #

Arguments

:: Relation pa a

Left query to join

-> Relation pb b

Right query to join

-> [JoinRestriction (Maybe a) (Maybe b)]

Join restrictions

-> Relation (pa, pb) (Maybe a, Maybe b)

Result joined relation

Direct full outer join with place-holder parameters.

inner infixl 8 Source #

Arguments

:: Relation () a

Left query to join

-> Relation () b

Right query to join

-> [JoinRestriction a b]

Join restrictions

-> Relation () (a, b)

Result joined relation

Direct inner join.

left infixl 8 Source #

Arguments

:: Relation () a

Left query to join

-> Relation () b

Right query to join

-> [JoinRestriction a (Maybe b)]

Join restrictions

-> Relation () (a, Maybe b)

Result joined relation

Direct left outer join.

right infixl 8 Source #

Arguments

:: Relation () a

Left query to join

-> Relation () b

Right query to join

-> [JoinRestriction (Maybe a) b]

Join restrictions

-> Relation () (Maybe a, b)

Result joined relation

Direct right outer join.

full infixl 8 Source #

Arguments

:: Relation () a

Left query to join

-> Relation () b

Right query to join

-> [JoinRestriction (Maybe a) (Maybe b)]

Join restrictions

-> Relation () (Maybe a, Maybe b)

Result joined relation

Direct full outer join.

on' :: ([JoinRestriction a b] -> Relation pc (a, b)) -> [JoinRestriction a b] -> Relation pc (a, b) infixl 8 Source #

Apply restriction for direct join style.

Relation append

union :: Relation () a -> Relation () a -> Relation () a infixl 7 Source #

Union of two relations.

except :: Relation () a -> Relation () a -> Relation () a infixl 7 Source #

Subtraction of two relations.

intersect :: Relation () a -> Relation () a -> Relation () a infixl 8 Source #

Intersection of two relations.

unionAll :: Relation () a -> Relation () a -> Relation () a infixl 7 Source #

Union of two relations. Not distinct.

exceptAll :: Relation () a -> Relation () a -> Relation () a infixl 7 Source #

Subtraction of two relations. Not distinct.

intersectAll :: Relation () a -> Relation () a -> Relation () a infixl 8 Source #

Intersection of two relations. Not distinct.

union' :: Relation p a -> Relation q a -> Relation (p, q) a infixl 7 Source #

Union of two relations with place-holder parameters.

except' :: Relation p a -> Relation q a -> Relation (p, q) a infixl 7 Source #

Subtraction of two relations with place-holder parameters.

intersect' :: Relation p a -> Relation q a -> Relation (p, q) a infixl 8 Source #

Intersection of two relations with place-holder parameters.

unionAll' :: Relation p a -> Relation q a -> Relation (p, q) a infixl 7 Source #

Union of two relations with place-holder parameters. Not distinct.

exceptAll' :: Relation p a -> Relation q a -> Relation (p, q) a infixl 7 Source #

Subtraction of two relations with place-holder parameters. Not distinct.

intersectAll' :: Relation p a -> Relation q a -> Relation (p, q) a infixl 8 Source #

Intersection of two relations with place-holder parameters. Not distinct.