Skip to content

Commit

Permalink
Do not error on any AppT in sqlMaybeSelectProcessRowDec
Browse files Browse the repository at this point in the history
No need to be this restrictive in deriveEsqueletoRecord
For example, AppT ListT _ and AppT (ConT _) _ are both fine but would
throw an error here before this change.
  • Loading branch information
csamak committed Nov 27, 2024
1 parent ba43f65 commit 52a2ae2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Database/Esqueleto/Record.hs
Original file line number Diff line number Diff line change
Expand Up @@ -935,10 +935,8 @@ sqlMaybeSelectProcessRowDec RecordInfo {..} = do
]
where
wrapJust x = case x of
AppT (ConT ((==) ''Entity -> True)) _innerType -> id
((ConT ((==) ''Maybe -> True)) `AppT` _inner) -> AppE (ConE 'Just)
(ConT _) -> id
_ -> error $ show x
_ -> id

-- | Generates the `sqlSelectColCount` declaration for an `SqlSelect` instance.
sqlMaybeSelectColCountDec :: RecordInfo -> Q Dec
Expand Down

0 comments on commit 52a2ae2

Please sign in to comment.