opaleye-0.6.0.0: An SQL-generating DSL targeting PostgreSQL

Safe HaskellNone
LanguageHaskell2010

Opaleye.Distinct

Synopsis

Documentation

distinct :: Default Distinctspec columns columns => Query columns -> Query columns Source #

Remove duplicate rows from the Query.

Example type specialization:

distinct :: Query (Column a, Column b) -> Query (Column a, Column b)

Assuming the makeAdaptorAndInstance splice has been run for the product type Foo:

distinct :: Query (Foo (Column a) (Column b) (Column c)) -> Query (Foo (Column a) (Column b) (Column c))

By design there is no distinct function of type QueryArr a b -> QueryArr a b. Such a function would allow violation of SQL's scoping rules and lead to invalid queries.

distinctExplicit :: Distinctspec columns columns' -> Query columns -> Query columns' Source #