This commit is contained in:
Kei Hibino 2013-05-22 12:05:12 +09:00
parent ea1f2aa153
commit bcaa16f77b
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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