Skip to content

Commit d08766a

Browse files
committed
feat: PR prep cleanup; changelog
1 parent 63df53d commit d08766a

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

changelog.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
3.5.10.2 (unreleased)
2+
=======
3+
- @ulidtko
4+
- PR TBD
5+
- Add `updateReturning`, `deleteReturning` as Postgres extensions.
6+
17
3.5.10.1
28
========
39
- @9999years
@@ -21,7 +27,6 @@
2127
- [#363](https://github.com/bitemyapp/esqueleto/pull/363)
2228
- Add missing `just` to left join examples in the Haddocks
2329

24-
2530
3.5.9.0
2631
=======
2732
- @9999years

src/Database/Esqueleto/Internal/Internal.hs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1882,9 +1882,7 @@ data CommonTableExpressionClause =
18821882

18831883
data ReturningClause
18841884
= ReturningNothing -- ^ The default, absent clause.
1885-
| ReturningStar -- ^ @RETURNING *@
1886-
-- | ReturningExprs (NonEmpty (SqlExpr Returning))
1887-
-- ^ @output_expression [ [ AS ] output_name ] [, ...]@
1885+
| ReturningStar -- ^ @RETURNING@ is present.
18881886

18891887
data SubQueryType
18901888
= NormalSubQuery
@@ -2128,7 +2126,6 @@ instance Semigroup ReturningClause where
21282126
(<>) ReturningNothing x = x
21292127
(<>) x ReturningNothing = x
21302128
(<>) ReturningStar ReturningStar = ReturningStar
2131-
-- (<>) _ _ = error "instance Semigroup FIXME"
21322129

21332130
instance Monoid ReturningClause where
21342131
mempty = ReturningNothing
@@ -2421,6 +2418,9 @@ existsHelper = sub SELECT . (>> return true)
24212418
--
24222419
-- Many constructs appearing in @SELECT@ can go under @RETURNING@ -- but not all (e.g.
24232420
-- certainly not subqueries, @VALUES@ and such). Thus, this is a subclass of 'SqlSelect'.
2421+
--
2422+
-- The fundeps duplicate those of 'SqlSelect' solely to provide somewhat more directly
2423+
-- understandable type errors.
24242424
class SqlSelect a r => InferReturning a r | r -> a, a -> r
24252425
instance PersistEntity ent => InferReturning (SqlExpr (Entity ent)) (Entity ent)
24262426
instance PersistEntity ent => InferReturning (SqlExpr (Maybe (Entity ent))) (Maybe (Entity ent))
@@ -3314,7 +3314,6 @@ makeReturning :: SqlSelect a r
33143314
=> IdentInfo -> ReturningClause -> a -> (TLB.Builder, [PersistValue])
33153315
makeReturning _ ReturningNothing _ = mempty
33163316
makeReturning info ReturningStar ret = ("RETURNING ", []) <> sqlSelectCols info ret
3317-
-- makeReturning info (ReturningExprs _) = undefined -- FIXME
33183317

33193318

33203319
parens :: TLB.Builder -> TLB.Builder

test/PostgreSQL/Test.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ testUpsert =
10581058

10591059
testUpdateDeleteReturning :: SpecDb
10601060
testUpdateDeleteReturning =
1061-
describe "UPDATE .. RETURNING *" $ do
1061+
describe "UPDATE .. RETURNING .." $ do
10621062
itDb "Whole entities, expressions and tuples get returned from UPDATE" $ do
10631063
[_p1k, _p2k, _p3k, p4k, _p5k] <- mapM insert [p1, p2, p3, p4, p5]
10641064
ret1 <- EP.updateReturning $ \p -> do

0 commit comments

Comments
 (0)