@@ -140,8 +140,7 @@ using `Squeal.PostgreSQL.PQ.runQuery`.
140140Generally, @parameters@ will be a Haskell tuple or record whose entries
141141may be referenced using positional
142142`Squeal.PostgreSQL.Expression.Parameter.parameter`s and @row@ will be a
143−Haskell record or a generalized record using tuples of `P` types and normal Haskell
144−records, whose entries will be targeted using overloaded labels.
143+Haskell record, whose entries will be targeted using overloaded labels.
145144
146145Let's see some examples of queries.
147146
@@ -212,15 +211,15 @@ aggregation query:
212211
213212>>> :{
214213let
215− query :: Query_ (Public Schema) () (Row Int32 Int32)
214+ query :: Query_ (Public Schema) () (Row Int64 Int32)
216215 query =
217216 select_ ((fromNull 0 (sum_ (All #col2))) `as` #col1 :* #col1 `as` #col2)
218217 ( from (table (#tab `as` #table1))
219218 & groupBy #col1
220− & having (#col1 + (fromNull 0 (sum_ (Distinct #col2))) .> 1) )
219+ & having (sum_ (Distinct #col2) .> 1) )
221220in printSQL query
222221:}
223−SELECT COALESCE(sum(ALL "col2"), 0) AS "col1", "col1" AS "col2" FROM "tab" AS "table1" GROUP BY "col1" HAVING (("col1" + COALESCE(sum(DISTINCT "col2"), 0)) > 1)
222+SELECT COALESCE(sum(ALL "col2"), 0) AS "col1", "col1" AS "col2" FROM "tab" AS "table1" GROUP BY "col1" HAVING (sum(DISTINCT "col2") > 1)
224223
225224sorted query:
226225
@@ -1023,19 +1022,19 @@ instance With (Query outer) where
10231022
10241023{- |
10251024>>> import Data.Monoid (Sum (..))
1026−>>> import Data.Int (Int32)
1025+>>> import Data.Int (Int64)
10271026>>> :{
10281027 let
1029− query :: Query_ schema () (Sum Int32)
1028+ query :: Query_ schema () (Sum Int64)
10301029 query = withRecursive
1031− ( values_ (1 `as` #n)
1030+ ( values_ ((1 & astype int) `as` #n)
10321031 `unionAll`
10331032 select_ ((#n + 1) `as` #n)
10341033 (from (common #t) & where_ (#n .< 100)) `as` #t )
10351034 ( select_ (fromNull 0 (sum_ (All #n)) `as` #getSum) (from (common #t) & groupBy Nil))
10361035 in printSQL query
10371036:}
1038−WITH RECURSIVE "t" AS ((SELECT * FROM (VALUES (1)) AS t ("n")) UNION ALL (SELECT ("n" + 1) AS "n" FROM "t" AS "t" WHERE ("n" < 100))) SELECT COALESCE(sum(ALL "n"), 0) AS "getSum" FROM "t" AS "t"
1037+WITH RECURSIVE "t" AS ((SELECT * FROM (VALUES ((1 :: int))) AS t ("n")) UNION ALL (SELECT ("n" + 1) AS "n" FROM "t" AS "t" WHERE ("n" < 100))) SELECT COALESCE(sum(ALL "n"), 0) AS "getSum" FROM "t" AS "t"
10391038-}
10401039withRecursive
10411040 :: Aliased (Query outer (recursive ': commons) schemas params) recursive