add support for with recursive and column aliases in cte
This commit is contained in:
parent
c52334943f
commit
4308acb982
7 changed files with 57 additions and 38 deletions
Language/SQL/SimpleSQL
|
@ -14,6 +14,7 @@
|
|||
> ,makeSelect
|
||||
> ,CombineOp(..)
|
||||
> ,Corresponding(..)
|
||||
> ,Alias(..)
|
||||
> -- ** From
|
||||
> ,TableRef(..)
|
||||
> ,JoinType(..)
|
||||
|
@ -152,13 +153,16 @@
|
|||
> ,qeOffset :: Maybe ScalarExpr
|
||||
> }
|
||||
> | CombineQueryExpr
|
||||
> {qe1 :: QueryExpr
|
||||
> {qe0 :: QueryExpr
|
||||
> ,qeCombOp :: CombineOp
|
||||
> ,qeDuplicates :: Duplicates
|
||||
> ,qeCorresponding :: Corresponding
|
||||
> ,qe2 :: QueryExpr
|
||||
> ,qe1 :: QueryExpr
|
||||
> }
|
||||
> | With [(Name,QueryExpr)] QueryExpr
|
||||
> | With
|
||||
> {qeWithRecursive :: Bool
|
||||
> ,qeViews :: [(Alias,QueryExpr)]
|
||||
> ,qeQueryExpression :: QueryExpr}
|
||||
> | Values [[ScalarExpr]]
|
||||
|
||||
> deriving (Eq,Show,Read)
|
||||
|
@ -200,7 +204,7 @@ I'm not sure if this is valid syntax or not.
|
|||
> -- | from (a)
|
||||
> | TRParens TableRef
|
||||
> -- | from a as b(c,d)
|
||||
> | TRAlias TableRef Name (Maybe [Name])
|
||||
> | TRAlias TableRef Alias
|
||||
> -- | from (query expr)
|
||||
> | TRQueryExpr QueryExpr
|
||||
> -- | from function(args)
|
||||
|
@ -209,6 +213,9 @@ I'm not sure if this is valid syntax or not.
|
|||
> | TRLateral TableRef
|
||||
> deriving (Eq,Show,Read)
|
||||
|
||||
> data Alias = Alias Name (Maybe [Name])
|
||||
> deriving (Eq,Show,Read)
|
||||
|
||||
TODO: add function table ref
|
||||
|
||||
> -- | The type of a join
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue