1
Fork 0

Merge remote-tracking branch 'soenkehahn/qualified_table_names'

This commit is contained in:
Jake Wheat 2014-01-22 22:16:04 +02:00
commit 59f8df8050
4 changed files with 7 additions and 0 deletions

View file

@ -601,6 +601,7 @@ tref
> *> nonJoinTref)
> ,try (TRFunction <$> name
> <*> parens (commaSep valueExpr))
> ,try (TRQualified <$> name <*> (char '.' >> name))
> ,TRSimple <$> name]
> >>= optionSuffix aliasSuffix
> aliasSuffix j = option j (TRAlias j <$> alias)

View file

@ -229,6 +229,7 @@ which have been changed to try to improve the layout of the output.
> ,nest 5 $ vcat $ punctuate comma $ map tr ts]
> where
> tr (TRSimple t) = name t
> tr (TRQualified s t) = name s <> text "." <> name t
> tr (TRLateral t) = text "lateral" <+> tr t
> tr (TRFunction f as) =
> name f <> parens (commaSep $ map valueExpr as)

View file

@ -282,6 +282,8 @@ I'm not sure if this is valid syntax or not.
> -- | Represents a entry in the csv of tables in the from clause.
> data TableRef = -- | from t
> TRSimple Name
> -- | from s.t
> | TRQualified Name Name
> -- | from a join b
> | TRJoin TableRef JoinType TableRef (Maybe JoinCondition)
> -- | from (a)

View file

@ -20,6 +20,9 @@ expression
> ,("select a from t,u"
> ,ms [TRSimple "t", TRSimple "u"])
> ,("select a from s.t"
> ,ms [TRQualified "s" "t"])
these lateral queries make no sense but the syntax is valid
> ,("select a from lateral a"