esqueleto-3.5.11.2: Type-safe EDSL for SQL queries on persistent backends.

Safe Haskell | Safe-Inferred
Language | Haskell2010

Database.Esqueleto.Experimental.From.SqlSetOperation

Synopsis

- newtype SqlSetOperation a = SqlSetOperation {
  - unSqlSetOperation :: NeedParens -> SqlQuery (a, IdentInfo -> (Builder, [PersistValue]))
  }
- class ToSqlSetOperation a r | a -> r where
  - toSqlSetOperation :: a -> SqlSetOperation r
- mkSetOperation :: (ToSqlSetOperation a a', ToSqlSetOperation b a') => Builder -> a -> b -> SqlSetOperation a'
- data Union a b = a `Union` b
- class Union_ a where
  - union_ :: a
- class UnionAll_ a where
  - unionAll_ :: a
- data UnionAll a b = a `UnionAll` b
- data Except a b = a `Except` b
- except_ :: (ToSqlSetOperation a a', ToSqlSetOperation b a') => a -> b -> SqlSetOperation a'
- data Intersect a b = a `Intersect` b
- intersect_ :: (ToSqlSetOperation a a', ToSqlSetOperation b a') => a -> b -> SqlSetOperation a'
- pattern SelectQuery :: p -> p

# Documentation

newtype SqlSetOperation a Source #

Data type used to implement the SqlSetOperation language this type is implemented in the same way as a `From`

Semantically a `SqlSetOperation` is always a `From` but not vice versa

Since: 3.5.0.0

Constructors

SqlSetOperation |

Fields

- unSqlSetOperation :: NeedParens -> SqlQuery (a, IdentInfo -> (Builder, [PersistValue]))

#### Instances

Instances details

ToAliasReference a => ToFrom (SqlSetOperation a) a Source # |
Instance details Defined in Database.Esqueleto.Experimental.From.SqlSetOperation Methods toFrom :: SqlSetOperation a -> From a Source #
ToSqlSetOperation (SqlSetOperation a) a Source # |
Instance details Defined in Database.Esqueleto.Experimental.From.SqlSetOperation Methods toSqlSetOperation :: SqlSetOperation a -> SqlSetOperation a Source #

class ToSqlSetOperation a r | a -> r where Source #

Type class to support direct use of `SqlQuery` in a set operation tree

Since: 3.5.0.0

Methods

toSqlSetOperation :: a -> SqlSetOperation r Source #

#### Instances

Instances details

ToSqlSetOperation (SqlSetOperation a) a Source # |
Instance details Defined in Database.Esqueleto.Experimental.From.SqlSetOperation Methods toSqlSetOperation :: SqlSetOperation a -> SqlSetOperation a Source #
(SqlSelect a r, ToAlias a, ToAliasReference a) => ToSqlSetOperation (SqlQuery a) a Source # |
Instance details Defined in Database.Esqueleto.Experimental.From.SqlSetOperation Methods toSqlSetOperation :: SqlQuery a -> SqlSetOperation a Source #
ToSqlSetOperation a a' => ToSqlSetOperation (Except a a) a' Source # |
Instance details Defined in Database.Esqueleto.Experimental.From.SqlSetOperation Methods toSqlSetOperation :: Except a a -> SqlSetOperation a' Source #
ToSqlSetOperation a a' => ToSqlSetOperation (Intersect a a) a' Source # |
Instance details Defined in Database.Esqueleto.Experimental.From.SqlSetOperation Methods toSqlSetOperation :: Intersect a a -> SqlSetOperation a' Source #
ToSqlSetOperation a a' => ToSqlSetOperation (Union a a) a' Source # |
Instance details Defined in Database.Esqueleto.Experimental.From.SqlSetOperation Methods toSqlSetOperation :: Union a a -> SqlSetOperation a' Source #
ToSqlSetOperation a a' => ToSqlSetOperation (UnionAll a a) a' Source # |
Instance details Defined in Database.Esqueleto.Experimental.From.SqlSetOperation Methods toSqlSetOperation :: UnionAll a a -> SqlSetOperation a' Source #

mkSetOperation :: (ToSqlSetOperation a a', ToSqlSetOperation b a') => Builder -> a -> b -> SqlSetOperation a' Source #

Helper function for defining set operations @since 3.5.0.0

data Union a b Source #

Deprecated: Since: 3.4.0.0 - Use the `union_` function instead of the `Union` data constructor

Constructors

a `Union` b | Deprecated: Since: 3.4.0.0 - Use the `union_` function instead of the `Union` data constructor

#### Instances

Instances details

ToSqlSetOperation a a' => ToSqlSetOperation (Union a a) a' Source # |
Instance details Defined in Database.Esqueleto.Experimental.From.SqlSetOperation Methods toSqlSetOperation :: Union a a -> SqlSetOperation a' Source #

class Union_ a where Source #

Overloaded `union_` function to support use in both `SqlSetOperation` and `withRecursive`

Since: 3.5.0.0

Methods

union_ :: a Source #

`UNION` SQL set operation. Can be used as an infix function between `SqlQuery` values.

#### Instances

Instances details

Union_ UnionKind Source # |
Instance details Defined in Database.Esqueleto.Experimental.From.CommonTableExpression Methods union_ :: UnionKind Source #
(ToSqlSetOperation a c, ToSqlSetOperation b c, res ~ SqlSetOperation c) => Union_ (a -> b -> res) Source # |
Instance details Defined in Database.Esqueleto.Experimental.From.SqlSetOperation Methods union_ :: a -> b -> res Source #

class UnionAll_ a where Source #

Overloaded `unionAll_` function to support use in both `SqlSetOperation` and `withRecursive`

Since: 3.5.0.0

Methods

unionAll_ :: a Source #

`UNION` `ALL` SQL set operation. Can be used as an infix function between `SqlQuery` values.

#### Instances

Instances details

UnionAll_ UnionKind Source # |
Instance details Defined in Database.Esqueleto.Experimental.From.CommonTableExpression Methods unionAll_ :: UnionKind Source #
(ToSqlSetOperation a c, ToSqlSetOperation b c, res ~ SqlSetOperation c) => UnionAll_ (a -> b -> res) Source # |
Instance details Defined in Database.Esqueleto.Experimental.From.SqlSetOperation Methods unionAll_ :: a -> b -> res Source #

data UnionAll a b Source #

Deprecated: Since: 3.4.0.0 - Use the `unionAll_` function instead of the `UnionAll` data constructor

Constructors

a `UnionAll` b | Deprecated: Since: 3.4.0.0 - Use the `unionAll_` function instead of the `UnionAll` data constructor

#### Instances

Instances details

ToSqlSetOperation a a' => ToSqlSetOperation (UnionAll a a) a' Source # |
Instance details Defined in Database.Esqueleto.Experimental.From.SqlSetOperation Methods toSqlSetOperation :: UnionAll a a -> SqlSetOperation a' Source #

data Except a b Source #

Deprecated: Since: 3.4.0.0 - Use the `except_` function instead of the `Except` data constructor

Constructors

a `Except` b | Deprecated: Since: 3.4.0.0 - Use the `except_` function instead of the `Except` data constructor

#### Instances

Instances details

ToSqlSetOperation a a' => ToSqlSetOperation (Except a a) a' Source # |
Instance details Defined in Database.Esqueleto.Experimental.From.SqlSetOperation Methods toSqlSetOperation :: Except a a -> SqlSetOperation a' Source #

except_ :: (ToSqlSetOperation a a', ToSqlSetOperation b a') => a -> b -> SqlSetOperation a' Source #

`EXCEPT` SQL set operation. Can be used as an infix function between `SqlQuery` values.

data Intersect a b Source #

Deprecated: Since: 3.4.0.0 - Use the `intersect_` function instead of the `Intersect` data constructor

Constructors

a `Intersect` b | Deprecated: Since: 3.4.0.0 - Use the `intersect_` function instead of the `Intersect` data constructor

#### Instances

Instances details

ToSqlSetOperation a a' => ToSqlSetOperation (Intersect a a) a' Source # |
Instance details Defined in Database.Esqueleto.Experimental.From.SqlSetOperation Methods toSqlSetOperation :: Intersect a a -> SqlSetOperation a' Source #

intersect_ :: (ToSqlSetOperation a a', ToSqlSetOperation b a') => a -> b -> SqlSetOperation a' Source #

`INTERSECT` SQL set operation. Can be used as an infix function between `SqlQuery` values.

pattern SelectQuery :: p -> p Source #

Deprecated: Since: 3.4.0.0 - It is no longer necessary to tag `SqlQuery` values with `SelectQuery`