rename CombineQueryExpr to QueryExprSetOp and CombineOp to SetOperatorName
This commit is contained in:
parent
a2645ace3f
commit
d52b5efc8b
|
@ -1523,7 +1523,7 @@ be in the public syntax?
|
||||||
> <*> option SQDefault duplicates
|
> <*> option SQDefault duplicates
|
||||||
> <*> corr
|
> <*> corr
|
||||||
> where
|
> where
|
||||||
> cq o d c q0 q1 = CombineQueryExpr q0 o d c q1
|
> cq o d c q0 q1 = QueryExprSetOp q0 o d c q1
|
||||||
> setOpK = choice [Union <$ keyword_ "union"
|
> setOpK = choice [Union <$ keyword_ "union"
|
||||||
> ,Intersect <$ keyword_ "intersect"
|
> ,Intersect <$ keyword_ "intersect"
|
||||||
> ,Except <$ keyword_ "except"]
|
> ,Except <$ keyword_ "except"]
|
||||||
|
|
|
@ -333,7 +333,7 @@ which have been changed to try to improve the layout of the output.
|
||||||
> else text "fetch first" <+> scalarExpr dia e
|
> else text "fetch first" <+> scalarExpr dia e
|
||||||
> <+> text "rows only") fe
|
> <+> text "rows only") fe
|
||||||
|
|
||||||
> queryExpr dia (CombineQueryExpr q1 ct d c q2) =
|
> queryExpr dia (QueryExprSetOp q1 ct d c q2) =
|
||||||
> sep [queryExpr dia q1
|
> sep [queryExpr dia q1
|
||||||
> ,text (case ct of
|
> ,text (case ct of
|
||||||
> Union -> "union"
|
> Union -> "union"
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
> -- * Query expressions
|
> -- * Query expressions
|
||||||
> ,QueryExpr(..)
|
> ,QueryExpr(..)
|
||||||
> ,makeSelect
|
> ,makeSelect
|
||||||
> ,CombineOp(..)
|
> ,SetOperatorName(..)
|
||||||
> ,Corresponding(..)
|
> ,Corresponding(..)
|
||||||
> ,Alias(..)
|
> ,Alias(..)
|
||||||
> ,GroupingExpr(..)
|
> ,GroupingExpr(..)
|
||||||
|
@ -211,7 +211,7 @@ in other places
|
||||||
> -- | Escape ScalarExpr Char
|
> -- | Escape ScalarExpr Char
|
||||||
> -- | UEscape ScalarExpr Char
|
> -- | UEscape ScalarExpr Char
|
||||||
> | Collate ScalarExpr [Name]
|
> | Collate ScalarExpr [Name]
|
||||||
> | MultisetBinOp ScalarExpr CombineOp SetQuantifier ScalarExpr
|
> | MultisetBinOp ScalarExpr SetOperatorName SetQuantifier ScalarExpr
|
||||||
> | MultisetCtor [ScalarExpr]
|
> | MultisetCtor [ScalarExpr]
|
||||||
> | MultisetQueryCtor QueryExpr
|
> | MultisetQueryCtor QueryExpr
|
||||||
> | NextValueFor [Name]
|
> | NextValueFor [Name]
|
||||||
|
@ -349,9 +349,9 @@ This would make some things a bit cleaner?
|
||||||
> ,qeOffset :: Maybe ScalarExpr
|
> ,qeOffset :: Maybe ScalarExpr
|
||||||
> ,qeFetchFirst :: Maybe ScalarExpr
|
> ,qeFetchFirst :: Maybe ScalarExpr
|
||||||
> }
|
> }
|
||||||
> | CombineQueryExpr
|
> | QueryExprSetOp
|
||||||
> {qe0 :: QueryExpr
|
> {qe0 :: QueryExpr
|
||||||
> ,qeCombOp :: CombineOp
|
> ,qeCombOp :: SetOperatorName
|
||||||
> ,qeSetQuantifier :: SetQuantifier
|
> ,qeSetQuantifier :: SetQuantifier
|
||||||
> ,qeCorresponding :: Corresponding
|
> ,qeCorresponding :: Corresponding
|
||||||
> ,qe1 :: QueryExpr
|
> ,qe1 :: QueryExpr
|
||||||
|
@ -402,7 +402,7 @@ I'm not sure if this is valid syntax or not.
|
||||||
> -- | The direction for a column in order by.
|
> -- | The direction for a column in order by.
|
||||||
> data Direction = DirDefault | Asc | Desc deriving (Eq,Show,Read,Data,Typeable)
|
> data Direction = DirDefault | Asc | Desc deriving (Eq,Show,Read,Data,Typeable)
|
||||||
> -- | Query expression set operators.
|
> -- | Query expression set operators.
|
||||||
> data CombineOp = Union | Except | Intersect deriving (Eq,Show,Read,Data,Typeable)
|
> data SetOperatorName = Union | Except | Intersect deriving (Eq,Show,Read,Data,Typeable)
|
||||||
> -- | Corresponding, an option for the set operators.
|
> -- | Corresponding, an option for the set operators.
|
||||||
> data Corresponding = Corresponding | Respectively deriving (Eq,Show,Read,Data,Typeable)
|
> data Corresponding = Corresponding | Respectively deriving (Eq,Show,Read,Data,Typeable)
|
||||||
|
|
||||||
|
|
|
@ -144,24 +144,24 @@ These are a few misc tests which don't fit anywhere else.
|
||||||
> combos :: TestItem
|
> combos :: TestItem
|
||||||
> combos = Group "combos" $ map (uncurry (TestQueryExpr ansi2011))
|
> combos = Group "combos" $ map (uncurry (TestQueryExpr ansi2011))
|
||||||
> [("select a from t union select b from u"
|
> [("select a from t union select b from u"
|
||||||
> ,CombineQueryExpr ms1 Union SQDefault Respectively ms2)
|
> ,QueryExprSetOp ms1 Union SQDefault Respectively ms2)
|
||||||
|
|
||||||
> ,("select a from t intersect select b from u"
|
> ,("select a from t intersect select b from u"
|
||||||
> ,CombineQueryExpr ms1 Intersect SQDefault Respectively ms2)
|
> ,QueryExprSetOp ms1 Intersect SQDefault Respectively ms2)
|
||||||
|
|
||||||
> ,("select a from t except all select b from u"
|
> ,("select a from t except all select b from u"
|
||||||
> ,CombineQueryExpr ms1 Except All Respectively ms2)
|
> ,QueryExprSetOp ms1 Except All Respectively ms2)
|
||||||
|
|
||||||
> ,("select a from t union distinct corresponding \
|
> ,("select a from t union distinct corresponding \
|
||||||
> \select b from u"
|
> \select b from u"
|
||||||
> ,CombineQueryExpr ms1 Union Distinct Corresponding ms2)
|
> ,QueryExprSetOp ms1 Union Distinct Corresponding ms2)
|
||||||
|
|
||||||
> ,("select a from t union select a from t union select a from t"
|
> ,("select a from t union select a from t union select a from t"
|
||||||
> -- TODO: union should be left associative. I think the others also
|
> -- TODO: union should be left associative. I think the others also
|
||||||
> -- so this needs to be fixed (new optionSuffix variation which
|
> -- so this needs to be fixed (new optionSuffix variation which
|
||||||
> -- handles this)
|
> -- handles this)
|
||||||
> ,CombineQueryExpr ms1 Union SQDefault Respectively
|
> ,QueryExprSetOp ms1 Union SQDefault Respectively
|
||||||
> (CombineQueryExpr ms1 Union SQDefault Respectively ms1))
|
> (QueryExprSetOp ms1 Union SQDefault Respectively ms1))
|
||||||
> ]
|
> ]
|
||||||
> where
|
> where
|
||||||
> ms1 = makeSelect
|
> ms1 = makeSelect
|
||||||
|
|
Loading…
Reference in a new issue