partial support for lateral
This commit is contained in:
parent
d49b3ddb99
commit
939189a04f
5 changed files with 36 additions and 8 deletions
Language/SQL/SimpleSQL
|
@ -505,6 +505,7 @@ tref
|
|||
> tref = nonJoinTref >>= optionSuffix joinTrefSuffix
|
||||
> nonJoinTref = choice [try (TRQueryExpr <$> parens queryExpr)
|
||||
> ,TRParens <$> parens tref
|
||||
> ,TRLateral <$> (try (keyword_ "lateral") *> tref)
|
||||
> ,try (TRFunction <$> identifierString
|
||||
> <*> parens (commaSep scalarExpr))
|
||||
> ,TRSimple <$> identifierString]
|
||||
|
@ -690,7 +691,7 @@ keyword parser also
|
|||
> ["select", "as", "from", "where", "having", "group", "order"
|
||||
> ,"limit", "offset"
|
||||
> ,"inner", "left", "right", "full", "natural", "join"
|
||||
> ,"cross", "on", "using"
|
||||
> ,"cross", "on", "using", "lateral"
|
||||
> ,"when", "then", "case", "end", "in"
|
||||
> ,"except", "intersect", "union"]
|
||||
|
||||
|
|
|
@ -182,6 +182,7 @@
|
|||
> ,nest 5 $ vcat $ punctuate comma $ map tr ts]
|
||||
> where
|
||||
> tr (TRSimple t) = text t
|
||||
> tr (TRLateral t) = text "lateral" <+> tr t
|
||||
> tr (TRFunction f as) =
|
||||
> text f <> parens (commaSep $ map scalarExpr as)
|
||||
> tr (TRAlias t a cs) =
|
||||
|
|
|
@ -197,6 +197,8 @@ I'm not sure if this is valid syntax or not.
|
|||
> | TRQueryExpr QueryExpr
|
||||
> -- | from function(args)
|
||||
> | TRFunction String [ScalarExpr]
|
||||
> -- | from lateral t
|
||||
> | TRLateral TableRef
|
||||
> deriving (Eq,Show,Read)
|
||||
|
||||
TODO: add function table ref
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue