opaleye-0.6.7004.1: 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 (Field a, Field b) -> Select (Field a, Field b)

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

distinct :: Select (Foo (Field a) (Field b) (Field c)) -> Select (Foo (Field a) (Field b) (Field 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 fields fields' -> Query fields -> Query fields' Source #