},
}
+=item * SELECT foo, bar baz FROM foo ORDER BY bar, baz DESC GROUP BY 1,3,2
+
+ {
+ type => 'select',
+ ast_version => 0.0001,
+ select => [
+ {
+ type => 'SelectComponent',
+ value => {
+ type => 'Identifier',
+ element1 => 'foo',
+ },
+ },
+ {
+ type => 'SelectComponent',
+ value => {
+ type => 'Identifier',
+ elements => 'bar',
+ },
+ },
+ {
+ type => 'SelectComponent',
+ value => {
+ type => 'Identifier',
+ element1 => 'baz',
+ },
+ },
+ ],
+ tables => {
+ type => 'TableIdentifier',
+ value => {
+ type => 'Identifier',
+ element1 => 'foo',
+ },
+ },
+ orderby => [
+ {
+ type => 'OrderbyComponent',
+ value => {
+ type => 'Identifier',
+ element1 => 'bar',
+ },
+ dir => 'ASC',
+ },
+ {
+ type => 'OrderbyComponent',
+ value => {
+ type => 'Identifier',
+ element1 => 'baz',
+ },
+ dir => 'DESC',
+ },
+ ],
+ groupby => [
+ {
+ type => 'GroupbyComponent',
+ value => {
+ type => 'Number',
+ value => 1,
+ },
+ },
+ {
+ type => 'GroupbyComponent',
+ value => {
+ type => 'Number',
+ value => 3,
+ },
+ },
+ {
+ type => 'GroupbyComponent',
+ value => {
+ type => 'Number',
+ value => 2,
+ },
+ },
+ ],
+ }
+
=back
=head1 AUTHORS
}
A USING clause is syntactic sugar for an ON clause and, as such, is not provided
-for by the AST. A join of a comma is identical to a CROSS JOIN. The on clause is
-optional.
+for by the AST. A join of a comma is identical to a CROSS JOIN and, as such, is
+not provided for by the AST. The on clause is optional.
=head3 where
This corresponds to the VALUES clause in an INSERT statement.
-A values clause is an ExpressionList and the unit is composed as follows.
+A values clause is an ExpressionList and the unit is composed as follows:
values => [
Expression,
This corresponds to the ORDER BY clause in a SELECT statement.
-An orderby clause is composed as follows:
+A orderby clause unit is an array of one or more OrderbyComponent units.
- OrderByComponent := XXX-TODO-XXX
- OrderByDirection := ASC | DESC
+The hash for a OrderbyComponent unit is composed as follows:
- OrderByComponent [ OrderByDirection ]
- [ , OrderByComponent [ OrderByDirection ] ]*
+ {
+ type => 'OrderbyComponent',
+ value => < Identifier | Number >
+ dir => '< ASC | DESC >',
+ }
+
+The dir element, if omitted, will be defaulted to ASC by the AST. The number
+corresponds to a column in the select clause.
=head3 groupby
This corresponds to the GROUP BY clause in a SELECT statement.
-An groupby clause is composed as follows:
+A groupby clause unit is an array of one or more GroupbyComponent units.
- GroupByComponent := XXX-TODO-XXX
+The hash for a GroupbyComponent unit is composed as follows:
+
+ {
+ type => 'GroupbyComponent',
+ value => < Identifier | Number >
+ }
- GroupByComponent [ , GroupByComponent ]*
+The number corresponds to a column in the select clause.
=head3 rows