Skip to content

Commit 2b8f2cf

Browse files
csamakparsonsmatt
andauthored
Do not error on any AppT in sqlMaybeSelectProcessRowDec (#406)
* Do not error on any AppT in sqlMaybeSelectProcessRowDec 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. * Apply suggestions from code review --------- Co-authored-by: Matt Parsons <[email protected]>
1 parent ba43f65 commit 2b8f2cf

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
3.5.13.1
2+
========
3+
- @csamak
4+
- [#405](https://github.com/bitemyapp/esqueleto/pull/405)
5+
- Fix a bug introduced in 3.5.12.0 where deriveEsqueletoRecord incorrectly errors
6+
17
3.5.13.0
28
========
39
- @ac251

esqueleto.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cabal-version: 1.12
22

33
name: esqueleto
44

5-
version: 3.5.13.0
5+
version: 3.5.13.1
66
synopsis: Type-safe EDSL for SQL queries on persistent backends.
77
description: @esqueleto@ is a bare bones, type-safe EDSL for SQL queries that works with unmodified @persistent@ SQL backends. Its language closely resembles SQL, so you don't have to learn new concepts, just new syntax, and it's fairly easy to predict the generated SQL and optimize it for your backend. Most kinds of errors committed when writing SQL are caught as compile-time errors---although it is possible to write type-checked @esqueleto@ queries that fail at runtime.
88
.

src/Database/Esqueleto/Record.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -935,10 +935,8 @@ sqlMaybeSelectProcessRowDec RecordInfo {..} = do
935935
]
936936
where
937937
wrapJust x = case x of
938-
AppT (ConT ((==) ''Entity -> True)) _innerType -> id
939938
((ConT ((==) ''Maybe -> True)) `AppT` _inner) -> AppE (ConE 'Just)
940-
(ConT _) -> id
941-
_ -> error $ show x
939+
_ -> id
942940

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

0 commit comments

Comments
 (0)