opaleye-0.6.7000.0: An SQL-generating DSL targeting PostgreSQL

Safe HaskellNone
LanguageHaskell2010

Opaleye.Distinct

Synopsis

Documentation

distinct :: Default Distinctspec fields fields => Select fields -> Select fields Source #

Remove duplicate rows from the Select.

Example type specialization:

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

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

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

By design there is no distinct function of type SelectArr a b -> SelectArr 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 #