Cleanup hackage documentation. Make sure stylish ran correctly. Update changelog and bump version
This commit is contained in:
parent
7b59829f3e
commit
9f6f9b325c
@ -1,3 +1,9 @@
|
||||
3.4.1.0
|
||||
=======
|
||||
- @belevy
|
||||
- [#228](https://github.com/bitemyapp/esqueleto/pull/228)
|
||||
- Remove From GADT in favor of From typeclass.
|
||||
|
||||
3.4.0.1
|
||||
=======
|
||||
- @arthurxavierx
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
cabal-version: 1.12
|
||||
|
||||
name: esqueleto
|
||||
version: 3.4.0.1
|
||||
version: 3.4.1.0
|
||||
synopsis: Type-safe EDSL for SQL queries on persistent backends.
|
||||
description: @esqueleto@ is a bare bones, type-safe EDSL for SQL queries that works with unmodified @persistent@ SQL backends. Its language closely resembles SQL, so you don't have to learn new concepts, just new syntax, and it's fairly easy to predict the generated SQL and optimize it for your backend. Most kinds of errors committed when writing SQL are caught as compile-time errors---although it is possible to write type-checked @esqueleto@ queries that fail at runtime.
|
||||
.
|
||||
|
||||
@ -19,10 +19,10 @@ module Database.Esqueleto.Experimental
|
||||
-- * Documentation
|
||||
|
||||
Table(..)
|
||||
, on
|
||||
, from
|
||||
, SubQuery(..)
|
||||
, (:&)(..)
|
||||
, on
|
||||
|
||||
-- ** Set Operations
|
||||
-- $sql-set-operations
|
||||
@ -47,6 +47,7 @@ module Database.Esqueleto.Experimental
|
||||
, ToAliasT
|
||||
, ToAliasReference(..)
|
||||
, ToAliasReferenceT
|
||||
, ToSetOperation(..)
|
||||
-- * The Normal Stuff
|
||||
|
||||
, where_
|
||||
@ -207,8 +208,8 @@ module Database.Esqueleto.Experimental
|
||||
import Database.Esqueleto.Internal.Internal hiding (From, from, on)
|
||||
import Database.Esqueleto.Internal.PersistentImport
|
||||
|
||||
import Database.Esqueleto.Experimental.From.CommonTableExpression
|
||||
import Database.Esqueleto.Experimental.From
|
||||
import Database.Esqueleto.Experimental.From.CommonTableExpression
|
||||
import Database.Esqueleto.Experimental.From.Join
|
||||
import Database.Esqueleto.Experimental.From.SqlSetOperation
|
||||
import Database.Esqueleto.Experimental.ToAlias
|
||||
@ -511,3 +512,37 @@ import Database.Esqueleto.Experimental.ToMaybe
|
||||
-- max_sale.amount)
|
||||
-- AS max_sale_customer;
|
||||
-- @
|
||||
|
||||
-- $sql-set-operations
|
||||
--
|
||||
-- Data type that represents SQL set operations. This includes
|
||||
-- 'UNION', 'UNION' 'ALL', 'EXCEPT', and 'INTERSECT'. These types form
|
||||
-- a binary tree, with @SqlQuery@ values on the leaves.
|
||||
--
|
||||
-- Each function corresponding to the aforementioned set operations
|
||||
-- can be used as an infix in a @from@ to help with readability
|
||||
-- and lead to code that closely resembles the underlying SQL. For example,
|
||||
--
|
||||
-- @
|
||||
-- select $ from $
|
||||
-- (do
|
||||
-- a <- from Table @A
|
||||
-- pure $ a ^. ASomeCol
|
||||
-- )
|
||||
-- \`union_\`
|
||||
-- (do
|
||||
-- b <- from Table @B
|
||||
-- pure $ b ^. BSomeCol
|
||||
-- )
|
||||
-- @
|
||||
--
|
||||
-- is translated into
|
||||
--
|
||||
-- @
|
||||
-- SELECT * FROM (
|
||||
-- (SELECT a.some_col FROM a)
|
||||
-- UNION
|
||||
-- (SELECT b.some_col FROM b)
|
||||
-- )
|
||||
-- @
|
||||
--
|
||||
|
||||
@ -16,10 +16,10 @@ module Database.Esqueleto.Experimental.From
|
||||
|
||||
import qualified Control.Monad.Trans.Writer as W
|
||||
import Data.Proxy
|
||||
import Database.Esqueleto.Internal.Internal hiding (From(..), from, on)
|
||||
import Database.Esqueleto.Internal.PersistentImport
|
||||
import Database.Esqueleto.Experimental.ToAlias
|
||||
import Database.Esqueleto.Experimental.ToAliasReference
|
||||
import Database.Esqueleto.Internal.Internal hiding (From(..), from, on)
|
||||
import Database.Esqueleto.Internal.PersistentImport
|
||||
|
||||
-- | 'FROM' clause, used to bring entities into scope.
|
||||
--
|
||||
|
||||
@ -71,8 +71,7 @@ type family ErrorOnLateral a :: Constraint where
|
||||
ErrorOnLateral (a -> SqlQuery b) = TypeError ('Text "LATERAL can only be used for INNER, LEFT, and CROSS join kinds.")
|
||||
ErrorOnLateral _ = ()
|
||||
|
||||
{-- Type class magic to allow the use of the `InnerJoin` family of data constructors in from --}
|
||||
|
||||
-- Type class magic to allow the use of the `InnerJoin` family of data constructors in from
|
||||
type family FromOnClause a where
|
||||
FromOnClause (a, b -> SqlExpr (Value Bool)) = b
|
||||
FromOnClause a = TypeError ('Text "Missing ON clause")
|
||||
|
||||
@ -84,39 +84,6 @@ runSetOperation operation = do
|
||||
(q2, v2) = operationToSql o2 info
|
||||
in (q1 <> " " <> operationText <> " " <> q2, v1 <> v2)
|
||||
|
||||
-- $sql-set-operations
|
||||
--
|
||||
-- Data type that represents SQL set operations. This includes
|
||||
-- 'UNION', 'UNION' 'ALL', 'EXCEPT', and 'INTERSECT'. These types form
|
||||
-- a binary tree, with @SqlQuery@ values on the leaves.
|
||||
--
|
||||
-- Each function corresponding to the aforementioned set operations
|
||||
-- can be used as an infix in a @from@ to help with readability
|
||||
-- and lead to code that closely resembles the underlying SQL. For example,
|
||||
--
|
||||
-- @
|
||||
-- select $ from $
|
||||
-- (do
|
||||
-- a <- from Table @A
|
||||
-- pure $ a ^. ASomeCol
|
||||
-- )
|
||||
-- \`union_\`
|
||||
-- (do
|
||||
-- b <- from Table @B
|
||||
-- pure $ b ^. BSomeCol
|
||||
-- )
|
||||
-- @
|
||||
--
|
||||
-- is translated into
|
||||
--
|
||||
-- @
|
||||
-- SELECT * FROM (
|
||||
-- (SELECT a.some_col FROM a)
|
||||
-- UNION
|
||||
-- (SELECT b.some_col FROM b)
|
||||
-- )
|
||||
-- @
|
||||
--
|
||||
|
||||
{-# DEPRECATED Union "/Since: 3.4.0.0/ - Use the 'union_' function instead of the 'Union' data constructor" #-}
|
||||
data Union a b = a `Union` b
|
||||
|
||||
Loading…
Reference in New Issue
Block a user