1
Fork 0

add syntax for new grouping expressions

This commit is contained in:
Jake Wheat 2013-12-17 19:17:03 +02:00
parent 7d094182b7
commit b703e04af3
9 changed files with 266 additions and 28 deletions
Language/SQL/SimpleSQL

View file

@ -20,6 +20,7 @@
> ,CombineOp(..)
> ,Corresponding(..)
> ,Alias(..)
> ,GroupingExpr(..)
> -- ** From
> ,TableRef(..)
> ,JoinType(..)
@ -189,7 +190,7 @@
> -- ^ the column aliases and the expressions
> ,qeFrom :: [TableRef]
> ,qeWhere :: Maybe ScalarExpr
> ,qeGroupBy :: [ScalarExpr]
> ,qeGroupBy :: [GroupingExpr]
> ,qeHaving :: Maybe ScalarExpr
> ,qeOrderBy :: [OrderField]
> ,qeOffset :: Maybe ScalarExpr
@ -240,6 +241,14 @@ I'm not sure if this is valid syntax or not.
> -- | Corresponding, an option for the set operators
> data Corresponding = Corresponding | Respectively deriving (Eq,Show,Read)
> data GroupingExpr
> = GroupingParens [GroupingExpr]
> | Cube [GroupingExpr]
> | Rollup [GroupingExpr]
> | GroupingSets [GroupingExpr]
> | SimpleGroup ScalarExpr
> deriving (Eq,Show,Read)
> -- | Represents a entry in the csv of tables in the from clause.
> data TableRef = -- | from t
> TRSimple Name