1
Fork 0

partial support for lateral

This commit is contained in:
Jake Wheat 2013-12-17 12:45:32 +02:00
parent d49b3ddb99
commit 939189a04f
5 changed files with 36 additions and 8 deletions
tools/Language/SQL/SimpleSQL

View file

@ -19,6 +19,30 @@ expression
> ,("select a from t,u"
> ,ms [TRSimple "t", TRSimple "u"])
these lateral queries make no sense but the syntax is valid
> ,("select a from lateral a"
> ,ms [TRLateral $ TRSimple "a"])
> ,("select a from lateral a,b"
> ,ms [TRLateral $ TRSimple "a", TRSimple "b"])
> -- not sure what the problem is
> --,("select from a, lateral b"
> -- ,ms [TRSimple "a", TRLateral $ TRSimple "b"])
> ,("select a from a natural join lateral b"
> ,ms [TRJoin (TRSimple "a") JInner
> (TRLateral $ TRSimple "b")
> (Just JoinNatural)])
> -- the lateral binds on the outside of the join which is incorrect
> --,("select a from lateral a natural join lateral b"
> -- ,ms [TRJoin (TRLateral $ TRSimple "a") JInner
> -- (TRLateral $ TRSimple "b")
> -- (Just JoinNatural)])
> ,("select a from t inner join u on expr"
> ,ms [TRJoin (TRSimple "t") JInner (TRSimple "u")
> (Just $ JoinOn $ Iden "expr")])