@@ -1882,9 +1882,7 @@ data CommonTableExpressionClause =
1882
1882
1883
1883
data ReturningClause
1884
1884
= ReturningNothing -- ^ The default, absent clause.
1885
- | ReturningStar -- ^ @RETURNING *@
1886
- -- | ReturningExprs (NonEmpty (SqlExpr Returning))
1887
- -- ^ @output_expression [ [ AS ] output_name ] [, ...]@
1885
+ | ReturningStar -- ^ @RETURNING@ is present.
1888
1886
1889
1887
data SubQueryType
1890
1888
= NormalSubQuery
@@ -2128,7 +2126,6 @@ instance Semigroup ReturningClause where
2128
2126
(<>) ReturningNothing x = x
2129
2127
(<>) x ReturningNothing = x
2130
2128
(<>) ReturningStar ReturningStar = ReturningStar
2131
- -- (<>) _ _ = error "instance Semigroup FIXME"
2132
2129
2133
2130
instance Monoid ReturningClause where
2134
2131
mempty = ReturningNothing
@@ -2421,6 +2418,9 @@ existsHelper = sub SELECT . (>> return true)
2421
2418
--
2422
2419
-- Many constructs appearing in @SELECT@ can go under @RETURNING@ -- but not all (e.g.
2423
2420
-- 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.
2424
2424
class SqlSelect a r => InferReturning a r | r -> a , a -> r
2425
2425
instance PersistEntity ent => InferReturning (SqlExpr (Entity ent )) (Entity ent )
2426
2426
instance PersistEntity ent => InferReturning (SqlExpr (Maybe (Entity ent ))) (Maybe (Entity ent ))
@@ -3314,7 +3314,6 @@ makeReturning :: SqlSelect a r
3314
3314
=> IdentInfo -> ReturningClause -> a -> (TLB. Builder , [PersistValue ])
3315
3315
makeReturning _ ReturningNothing _ = mempty
3316
3316
makeReturning info ReturningStar ret = (" RETURNING " , [] ) <> sqlSelectCols info ret
3317
- -- makeReturning info (ReturningExprs _) = undefined -- FIXME
3318
3317
3319
3318
3320
3319
parens :: TLB. Builder -> TLB. Builder
0 commit comments