rel8-internal
Safe HaskellNone
LanguageHaskell2010

Rel8.Internal.Query.List

Synopsis

Documentation

many :: Table Expr a => Query a -> Query (ListTable Expr a) Source #

Aggregate a Query into a ListTable. If the supplied query returns 0 rows, this function will produce a Query that returns one row containing the empty ListTable. If the supplied Query does return rows, many will return exactly one row, with a ListTable collecting all returned rows.

many is analogous to many from Control.Applicative.

some :: Table Expr a => Query a -> Query (NonEmptyTable Expr a) Source #

Aggregate a Query into a NonEmptyTable. If the supplied query returns 0 rows, this function will produce a Query that is empty - that is, will produce zero NonEmptyTables. If the supplied Query does return rows, some will return exactly one row, with a NonEmptyTable collecting all returned rows.

some is analogous to some from Control.Applicative.

manyExpr :: Sql DBType a => Query (Expr a) -> Query (Expr [a]) Source #

A version of many specialised to single expressions.

someExpr :: Sql DBType a => Query (Expr a) -> Query (Expr (NonEmpty a)) Source #

A version of some specialised to single expressions.

catListTable :: Table Expr a => ListTable Expr a -> Query a Source #

Expand a ListTable into a Query, where each row in the query is an element of the given ListTable.

catListTable is an inverse to many.

catNonEmptyTable :: Table Expr a => NonEmptyTable Expr a -> Query a Source #

Expand a NonEmptyTable into a Query, where each row in the query is an element of the given NonEmptyTable.

catNonEmptyTable is an inverse to some.

catList :: Sql DBType a => Expr [a] -> Query (Expr a) Source #

Expand an expression that contains a list into a Query, where each row in the query is an element of the given list.

catList is an inverse to manyExpr.

catNonEmpty :: Sql DBType a => Expr (NonEmpty a) -> Query (Expr a) Source #

Expand an expression that contains a non-empty list into a Query, where each row in the query is an element of the given list.

catNonEmpty is an inverse to someExpr.