HORIZON HASKELLDocslts/ghc-10.0.x8c2f8e82026-10-19Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8c2f8e8 · 2026-10-19

Moduleesqueleto-3.6.0.3Haskell2010

Database.Esqueleto.Experimental.From

  • 3 types
  • 1 class
  • 3 values
valuefrom :: ToFrom a a' => a -> SqlQuery a'
#

FROM clause, used to bring entities into scope.

Internally, this function uses the From datatype. Unlike the old Database.Esqueleto.from, this does not take a function as a parameter, but rather a value that represents a JOIN tree constructed out of instances of From. This implementation eliminates certain types of runtime errors by preventing the construction of invalid SQL (e.g. illegal nested-from).

newtypenewtype From a
#

Data type defining the From language. This should not constructed directly in application code.

A From is a SqlQuery which returns a reference to the result of calling from and a function that produces a portion of a FROM clause. This gets passed to the FromRaw FromClause constructor directly when converting from a From to a SqlQuery using from

Constructors

Instances1ToFrom
  • ToFrom (From a) aDefined in esqueleto-3.6.0.3 · Database.Esqueleto.Experimental.From
classclass ToFrom a r | a -> r where
#

A helper class primarily designed to allow using SqlQuery directly in a From expression. This is also useful for embedding a SqlSetOperation, as well as supporting backwards compatibility for the data constructor join tree used prior to 3.5.0.0

Methods

Instances9ToFrom, …
valueselectQuery
  1. :: (SqlSelect a r, ToAlias a, ToAliasReference a)
  2. => SqlQuery a
  3. -> From a
#

Select from a subquery, often used in conjuction with joins but can be used without any joins. Because SqlQuery has a ToFrom instance you probably dont need to use this function directly.

select $
     p <- from $
             selectQuery do
             p <- from $ table @Person
             limit 5
             orderBy [ asc p ^. PersonAge ]
     ...