packages feed

squeal-postgresql 0.6.0.0 → 0.6.0.1

raw patch · 3 files changed

+39/−1 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

squeal-postgresql.cabal view
@@ -1,5 +1,5 @@ name: squeal-postgresql-version: 0.6.0.0+version: 0.6.0.1 synopsis: Squeal PostgreSQL Library description: Squeal is a type-safe embedding of PostgreSQL in Haskell homepage: https://github.com/morphismtech/squeal
src/Squeal/PostgreSQL/Expression/Aggregate.hs view
@@ -85,6 +85,7 @@   -- count(ALL "col")   count     :: arg '[ty] lat with db params from+    -- ^ argument     -> expr lat with db params from ('NotNull 'PGint8)    -- | >>> :{@@ -96,9 +97,11 @@   -- sum(DISTINCT "col") FILTER (WHERE ("col" < (100.0 :: numeric)))   sum_     :: arg '[null ty] lat with db params from+    -- ^ argument     -> expr lat with db params from ('Null (PGSum ty))    -- | input values, including nulls, concatenated into an array+  --   -- >>> :{   -- let   --   expression :: Expression ('Grouped bys) '[] with db params '[tab ::: '["col" ::: 'Null 'PGnumeric]] ('Null ('PGvararray ('Null 'PGnumeric)))@@ -108,16 +111,19 @@   -- array_agg(ALL "col" ORDER BY "col" ASC NULLS FIRST) FILTER (WHERE ("col" < (100.0 :: numeric)))   arrayAgg     :: arg '[ty] lat with db params from+    -- ^ argument     -> expr lat with db params from ('Null ('PGvararray ty))    -- | aggregates values as a JSON array   jsonAgg     :: arg '[ty] lat with db params from+    -- ^ argument     -> expr lat with db params from ('Null 'PGjson)    -- | aggregates values as a JSON array   jsonbAgg     :: arg '[ty] lat with db params from+    -- ^ argument     -> expr lat with db params from ('Null 'PGjsonb)    {- |@@ -134,6 +140,7 @@   bitAnd     :: int `In` PGIntegral     => arg '[null int] lat with db params from+    -- ^ argument     -> expr lat with db params from ('Null int)    {- |@@ -150,6 +157,7 @@   bitOr     :: int `In` PGIntegral     => arg '[null int] lat with db params from+    -- ^ argument     -> expr lat with db params from ('Null int)    {- |@@ -165,6 +173,7 @@   -}   boolAnd     :: arg '[null 'PGbool] lat with db params from+    -- ^ argument     -> expr lat with db params from ('Null 'PGbool)    {- |@@ -180,6 +189,7 @@   -}   boolOr     :: arg '[null 'PGbool] lat with db params from+    -- ^ argument     -> expr lat with db params from ('Null 'PGbool)    {- |@@ -195,21 +205,25 @@   -}   every     :: arg '[null 'PGbool] lat with db params from+    -- ^ argument     -> expr lat with db params from ('Null 'PGbool)    {- |maximum value of expression across all input values-}   max_     :: arg '[null ty] lat with db params from+    -- ^ argument     -> expr lat with db params from ('Null ty)    -- | minimum value of expression across all input values   min_     :: arg '[null ty] lat with db params from+    -- ^ argument     -> expr lat with db params from ('Null ty)    -- | the average (arithmetic mean) of all input values   avg     :: arg '[null ty] lat with db params from+    -- ^ argument     -> expr lat with db params from ('Null (PGAvg ty))    {- | correlation coefficient@@ -224,6 +238,7 @@   -}   corr     :: arg '[null 'PGfloat8, null 'PGfloat8] lat with db params from+    -- ^ arguments     -> expr lat with db params from ('Null 'PGfloat8)    {- | population covariance@@ -238,6 +253,7 @@   -}   covarPop     :: arg '[null 'PGfloat8, null 'PGfloat8] lat with db params from+    -- ^ arguments     -> expr lat with db params from ('Null 'PGfloat8)    {- | sample covariance@@ -252,6 +268,7 @@   -}   covarSamp     :: arg '[null 'PGfloat8, null 'PGfloat8] lat with db params from+    -- ^ arguments     -> expr lat with db params from ('Null 'PGfloat8)    {- | average of the independent variable (sum(X)/N)@@ -266,6 +283,7 @@   -}   regrAvgX     :: arg '[null 'PGfloat8, null 'PGfloat8] lat with db params from+    -- ^ arguments     -> expr lat with db params from ('Null 'PGfloat8)    {- | average of the dependent variable (sum(Y)/N)@@ -280,6 +298,7 @@   -}   regrAvgY     :: arg '[null 'PGfloat8, null 'PGfloat8] lat with db params from+    -- ^ arguments     -> expr lat with db params from ('Null 'PGfloat8)    {- | number of input rows in which both expressions are nonnull@@ -294,9 +313,11 @@   -}   regrCount     :: arg '[null 'PGfloat8, null 'PGfloat8] lat with db params from+    -- ^ arguments     -> expr lat with db params from ('Null 'PGint8)    {- | y-intercept of the least-squares-fit linear equation determined by the (X, Y) pairs+   >>> :{   let     expression :: Expression ('Grouped g) '[] c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('Null 'PGfloat8)@@ -307,67 +328,79 @@   -}   regrIntercept     :: arg '[null 'PGfloat8, null 'PGfloat8] lat with db params from+    -- ^ arguments     -> expr lat with db params from ('Null 'PGfloat8)    -- | @regr_r2(Y, X)@, square of the correlation coefficient   regrR2     :: arg '[null 'PGfloat8, null 'PGfloat8] lat with db params from+    -- ^ arguments     -> expr lat with db params from ('Null 'PGfloat8)    -- | @regr_slope(Y, X)@, slope of the least-squares-fit linear equation   -- determined by the (X, Y) pairs   regrSlope     :: arg '[null 'PGfloat8, null 'PGfloat8] lat with db params from+    -- ^ arguments     -> expr lat with db params from ('Null 'PGfloat8)    -- | @regr_sxx(Y, X)@, sum(X^2) - sum(X)^2/N   -- (“sum of squares” of the independent variable)   regrSxx     :: arg '[null 'PGfloat8, null 'PGfloat8] lat with db params from+    -- ^ arguments     -> expr lat with db params from ('Null 'PGfloat8)    -- | @regr_sxy(Y, X)@, sum(X*Y) - sum(X) * sum(Y)/N   -- (“sum of products” of independent times dependent variable)   regrSxy     :: arg '[null 'PGfloat8, null 'PGfloat8] lat with db params from+    -- ^ arguments     -> expr lat with db params from ('Null 'PGfloat8)    -- | @regr_syy(Y, X)@, sum(Y^2) - sum(Y)^2/N   -- (“sum of squares” of the dependent variable)   regrSyy     :: arg '[null 'PGfloat8, null 'PGfloat8] lat with db params from+    -- ^ arguments     -> expr lat with db params from ('Null 'PGfloat8)    -- | historical alias for `stddevSamp`   stddev     :: arg '[null ty] lat with db params from+    -- ^ argument     -> expr lat with db params from ('Null (PGAvg ty))    -- | population standard deviation of the input values   stddevPop     :: arg '[null ty] lat with db params from+    -- ^ argument     -> expr lat with db params from ('Null (PGAvg ty))    -- | sample standard deviation of the input values   stddevSamp     :: arg '[null ty] lat with db params from+    -- ^ argument     -> expr lat with db params from ('Null (PGAvg ty))    -- | historical alias for `varSamp`   variance     :: arg '[null ty] lat with db params from+    -- ^ argument     -> expr lat with db params from ('Null (PGAvg ty))    -- | population variance of the input values   -- (square of the population standard deviation)   varPop     :: arg '[null ty] lat with db params from+    -- ^ argument     -> expr lat with db params from ('Null (PGAvg ty))    -- | sample variance of the input values   -- (square of the sample standard deviation)   varSamp     :: arg '[null ty] lat with db params from+    -- ^ argument     -> expr lat with db params from ('Null (PGAvg ty))  {- |
src/Squeal/PostgreSQL/Expression/Array.hs view
@@ -52,6 +52,7 @@ -- >>> import Squeal.PostgreSQL  -- | Construct an array.+-- -- >>> printSQL $ array [null_, false, true] -- ARRAY[NULL, FALSE, TRUE] array@@ -62,6 +63,7 @@   bracketed (commaSeparated (renderSQL <$> xs))  -- | Safely construct an empty array.+-- -- >>> printSQL $ array0 text -- (ARRAY[] :: text[]) array0@@ -135,5 +137,8 @@   parenthesized (renderSQL expr) <> "[" <> fromString (show n) <> "]"  -- | Expand an array to a set of rows+--+-- >>> printSQL $ unnest (array [null_, false, true])+-- unnest(ARRAY[NULL, FALSE, TRUE]) unnest :: null ('PGvararray ty) -|-> ("unnest" ::: '["unnest" ::: ty]) unnest = unsafeSetFunction "unnest"