Hoogle Search

Within LTS Haskell 22.42 (ghc-9.6.6)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. from :: From a => (a -> SqlQuery b) -> SqlQuery b

    esqueleto Database.Esqueleto

    FROM clause: bring entities into scope. Note that this function will be replaced by the one in Database.Esqueleto.Experimental in version 4.0.0.0 of the library. The Experimental module has a dramatically improved means for introducing tables and entities that provides more power and less potential for runtime errors. This function internally uses two type classes in order to provide some flexibility of how you may call it. Internally we refer to these type classes as the two different magics. The innermost magic allows you to use from with the following types:

    • expr (Entity val), which brings a single entity into scope.
    • expr (Maybe (Entity val)), which brings a single entity that may be NULL into scope. Used for OUTER JOINs.
    • A JOIN of any other two types allowed by the innermost magic, where a JOIN may be an InnerJoin, a CrossJoin, a LeftOuterJoin, a RightOuterJoin, or a FullOuterJoin. The JOINs have left fixity.
    The outermost magic allows you to use from on any tuples of types supported by innermost magic (and also tuples of tuples, and so on), up to 8-tuples. Note that using from for the same entity twice does work and corresponds to a self-join. You don't even need to use two different calls to from, you may use a JOIN or a tuple. The following are valid examples of uses of from (the types of the arguments of the lambda are inside square brackets):
    from $ \person -> ...
    from $ \(person, blogPost) -> ...
    from $ \(p `LeftOuterJoin` mb) -> ...
    from $ \(p1 `InnerJoin` f `InnerJoin` p2) -> ...
    from $ \((p1 `InnerJoin` f) `InnerJoin` p2) -> ...
    
    The types of the arguments to the lambdas above are, respectively:
    person
    :: ( Esqueleto query expr backend
    , PersistEntity Person
    , PersistEntityBackend Person ~ backend
    ) => expr (Entity Person)
    (person, blogPost)
    :: (...) => (expr (Entity Person), expr (Entity BlogPost))
    (p `LeftOuterJoin` mb)
    :: (...) => InnerJoin (expr (Entity Person)) (expr (Maybe (Entity BlogPost)))
    (p1 `InnerJoin` f `InnerJoin` p2)
    :: (...) => InnerJoin
    (InnerJoin (expr (Entity Person))
    (expr (Entity Follow)))
    (expr (Entity Person))
    (p1 `InnerJoin` (f `InnerJoin` p2)) ::
    :: (...) => InnerJoin
    (expr (Entity Person))
    (InnerJoin (expr (Entity Follow))
    (expr (Entity Person)))
    
    Note that some backends may not support all kinds of JOINs.

  2. from :: ToFrom a a' => a -> SqlQuery a'

    esqueleto Database.Esqueleto.Experimental

    FROM clause, used to bring entities into scope. Internally, this function uses the From datatype. Unlike the old 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).

  3. from :: ToFrom a a' => a -> SqlQuery a'

    esqueleto Database.Esqueleto.Experimental.From

    FROM clause, used to bring entities into scope. Internally, this function uses the From datatype. Unlike the old 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).

  4. from :: From a => (a -> SqlQuery b) -> SqlQuery b

    esqueleto Database.Esqueleto.Internal.Internal

    FROM clause: bring entities into scope. Note that this function will be replaced by the one in Database.Esqueleto.Experimental in version 4.0.0.0 of the library. The Experimental module has a dramatically improved means for introducing tables and entities that provides more power and less potential for runtime errors. This function internally uses two type classes in order to provide some flexibility of how you may call it. Internally we refer to these type classes as the two different magics. The innermost magic allows you to use from with the following types:

    • expr (Entity val), which brings a single entity into scope.
    • expr (Maybe (Entity val)), which brings a single entity that may be NULL into scope. Used for OUTER JOINs.
    • A JOIN of any other two types allowed by the innermost magic, where a JOIN may be an InnerJoin, a CrossJoin, a LeftOuterJoin, a RightOuterJoin, or a FullOuterJoin. The JOINs have left fixity.
    The outermost magic allows you to use from on any tuples of types supported by innermost magic (and also tuples of tuples, and so on), up to 8-tuples. Note that using from for the same entity twice does work and corresponds to a self-join. You don't even need to use two different calls to from, you may use a JOIN or a tuple. The following are valid examples of uses of from (the types of the arguments of the lambda are inside square brackets):
    from $ \person -> ...
    from $ \(person, blogPost) -> ...
    from $ \(p `LeftOuterJoin` mb) -> ...
    from $ \(p1 `InnerJoin` f `InnerJoin` p2) -> ...
    from $ \((p1 `InnerJoin` f) `InnerJoin` p2) -> ...
    
    The types of the arguments to the lambdas above are, respectively:
    person
    :: ( Esqueleto query expr backend
    , PersistEntity Person
    , PersistEntityBackend Person ~ backend
    ) => expr (Entity Person)
    (person, blogPost)
    :: (...) => (expr (Entity Person), expr (Entity BlogPost))
    (p `LeftOuterJoin` mb)
    :: (...) => InnerJoin (expr (Entity Person)) (expr (Maybe (Entity BlogPost)))
    (p1 `InnerJoin` f `InnerJoin` p2)
    :: (...) => InnerJoin
    (InnerJoin (expr (Entity Person))
    (expr (Entity Follow)))
    (expr (Entity Person))
    (p1 `InnerJoin` (f `InnerJoin` p2)) ::
    :: (...) => InnerJoin
    (expr (Entity Person))
    (InnerJoin (expr (Entity Follow))
    (expr (Entity Person)))
    
    Note that some backends may not support all kinds of JOINs.

  5. from :: From a => (a -> SqlQuery b) -> SqlQuery b

    esqueleto Database.Esqueleto.Legacy

    FROM clause: bring entities into scope. Note that this function will be replaced by the one in Database.Esqueleto.Experimental in version 4.0.0.0 of the library. The Experimental module has a dramatically improved means for introducing tables and entities that provides more power and less potential for runtime errors. This function internally uses two type classes in order to provide some flexibility of how you may call it. Internally we refer to these type classes as the two different magics. The innermost magic allows you to use from with the following types:

    • expr (Entity val), which brings a single entity into scope.
    • expr (Maybe (Entity val)), which brings a single entity that may be NULL into scope. Used for OUTER JOINs.
    • A JOIN of any other two types allowed by the innermost magic, where a JOIN may be an InnerJoin, a CrossJoin, a LeftOuterJoin, a RightOuterJoin, or a FullOuterJoin. The JOINs have left fixity.
    The outermost magic allows you to use from on any tuples of types supported by innermost magic (and also tuples of tuples, and so on), up to 8-tuples. Note that using from for the same entity twice does work and corresponds to a self-join. You don't even need to use two different calls to from, you may use a JOIN or a tuple. The following are valid examples of uses of from (the types of the arguments of the lambda are inside square brackets):
    from $ \person -> ...
    from $ \(person, blogPost) -> ...
    from $ \(p `LeftOuterJoin` mb) -> ...
    from $ \(p1 `InnerJoin` f `InnerJoin` p2) -> ...
    from $ \((p1 `InnerJoin` f) `InnerJoin` p2) -> ...
    
    The types of the arguments to the lambdas above are, respectively:
    person
    :: ( Esqueleto query expr backend
    , PersistEntity Person
    , PersistEntityBackend Person ~ backend
    ) => expr (Entity Person)
    (person, blogPost)
    :: (...) => (expr (Entity Person), expr (Entity BlogPost))
    (p `LeftOuterJoin` mb)
    :: (...) => InnerJoin (expr (Entity Person)) (expr (Maybe (Entity BlogPost)))
    (p1 `InnerJoin` f `InnerJoin` p2)
    :: (...) => InnerJoin
    (InnerJoin (expr (Entity Person))
    (expr (Entity Follow)))
    (expr (Entity Person))
    (p1 `InnerJoin` (f `InnerJoin` p2)) ::
    :: (...) => InnerJoin
    (expr (Entity Person))
    (InnerJoin (expr (Entity Follow))
    (expr (Entity Person)))
    
    Note that some backends may not support all kinds of JOINs.

  6. class From a

    esqueleto Database.Esqueleto

    (Internal) Class that implements the tuple from magic (see fromStart).

  7. newtype From a

    esqueleto Database.Esqueleto.Experimental

    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

  8. From :: SqlQuery (a, RawFn) -> From a

    esqueleto Database.Esqueleto.Experimental

    No documentation available.

  9. module Database.Esqueleto.Experimental.From

    No documentation available.

  10. newtype From a

    esqueleto Database.Esqueleto.Experimental.From

    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

Page 1 of many | Next