Skip to content

Commit

Permalink
Fix bug where SqlDeconstructMaybe instance would consider a record to…
Browse files Browse the repository at this point in the history
… be Nothing if any one of its fields was Nothing.
  • Loading branch information
cgibbard committed Jan 10, 2023
1 parent f537ac5 commit 325fa1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion beam-core/Database/Beam/Query/Combinators.hs
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ instance BeamSqlBackend be => SqlDeconstructMaybe be (QGenExpr ctxt be s (Maybe

instance ( BeamSqlBackend be, Beamable t)
=> SqlDeconstructMaybe be (t (Nullable (QGenExpr ctxt be s))) (t (QGenExpr ctxt be s)) s where
isJust_ t = allE (allBeamValues (\(Columnar' e) -> isJust_ e) t)
isJust_ t = not_ (isNothing_ t)
isNothing_ t = allE (allBeamValues (\(Columnar' e) -> isNothing_ e) t)
maybe_ (QExpr onNothing) onJust tbl =
let QExpr onJust' = onJust (changeBeamRep (\(Columnar' (QExpr e)) -> Columnar' (QExpr e)) tbl)
Expand Down

0 comments on commit 325fa1c

Please sign in to comment.