diff --git a/relational-join/src/Database/Relational/Query/Internal/Context.hs b/relational-join/src/Database/Relational/Query/Internal/Context.hs index d6635e7f..380e7357 100644 --- a/relational-join/src/Database/Relational/Query/Internal/Context.hs +++ b/relational-join/src/Database/Relational/Query/Internal/Context.hs @@ -7,7 +7,7 @@ module Database.Relational.Query.Internal.Context ( nextAlias, updateProduct, takeProduct, restoreLeft, - updateRestriction, + addRestriction, updateOrderBy, takeOrderBys, restoreLowOrderBys, composeSQL @@ -64,8 +64,8 @@ takeProduct ctx = (product ctx, updateProduct' (const Nothing) ctx) restoreLeft :: QueryProductNode -> Product.NodeAttr -> Context -> Context restoreLeft pL naR ctx = updateProduct (Product.growLeft pL naR) ctx -updateRestriction :: Expr Bool -> Context -> Context -updateRestriction e1 ctx = +addRestriction :: Expr Bool -> Context -> Context +addRestriction e1 ctx = ctx { restriction = Just . uf . restriction $ ctx } where uf Nothing = e1 uf (Just e0) = e0 `Projectable.and` e1 diff --git a/relational-join/src/Database/Relational/Query/Join.hs b/relational-join/src/Database/Relational/Query/Join.hs index 182311c8..a8f13320 100644 --- a/relational-join/src/Database/Relational/Query/Join.hs +++ b/relational-join/src/Database/Relational/Query/Join.hs @@ -66,11 +66,11 @@ updateContext uf = updateJoinRestriction :: Expr Bool -> QueryJoin () updateJoinRestriction e = updateContext (updateProduct d) where - d Nothing = error "addProductRestriction: product is empty!" + d Nothing = error "on: product is empty!" d (Just pt) = restrictProduct pt e updateRestriction :: Expr Bool -> QueryJoin () -updateRestriction e = updateContext (Context.updateRestriction e) +updateRestriction e = updateContext (Context.addRestriction e) takeProduct :: QueryJoin (Maybe QueryProductNode) takeProduct = QueryJoin Context.takeProduct