{
type => 'SelectComponent',
value => {
- type => 'Value',
- subtype => 'number',
- value => 1,
+ type => 'Identifier',
+ element1 => '*',
},
},
],
element1 => 'John',
},
],
- }
+ },
}
+=item SELECT COUNT(*) FROM foo WHERE name = 'John' AND ( title = 'Mr' OR abbrev = 'Dr' )
+
+ {
+ type => 'select',
+ ast_version => 0.0001,
+ select => [
+ {
+ type => 'SelectComponent',
+ value => {
+ type => 'Identifier',
+ element1 => '*',
+ },
+ },
+ ],
+ tables => {
+ type => 'TableIdentifier',
+ value => {
+ type => 'Identifier',
+ element1 => 'foo',
+ },
+ },
+ where => {
+ type => 'Operator',
+ op => 'AND',
+ args => [
+ {
+ type => 'Operator',
+ op => '=',
+ args => [
+ {
+ type => 'Identifier',
+ element1 => 'name',
+ },
+ {
+ type => 'Value',
+ subtype => 'String',
+ element1 => 'John',
+ },
+ ],
+ },
+ {
+ type => 'Nesting',
+ args => [
+ {
+ type => 'Operator',
+ op => 'OR',
+ args => [
+ {
+ type => 'Operator',
+ op => '=',
+ args => [
+ {
+ type => 'Identifier',
+ element1 => 'title',
+ },
+ {
+ type => 'Value',
+ subtype => 'String',
+ element1 => 'Mr',
+ },
+ ],
+ },
+ {
+ type => 'Operator',
+ op => '=',
+ args => [
+ {
+ type => 'Identifier',
+ element1 => 'abbrev',
+ },
+ {
+ type => 'Value',
+ subtype => 'String',
+ element1 => 'Dr',
+ },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+ }
+
=back
=head1 AUTHORS
Visitors are expected to, by default, quote all identifiers according to the SQL
dialect's quoting scheme.
+Any of the elements may be '*', as in SELECT * or SELECT COUNT(*). Visitors must
+be careful to I<not> quote asterisks.
+
=head3 Value
A Value is a Perl scalar. Depending on the type, a Visitor may be able to make
An ExpressionList is always rendered in SQL with parentheses around it.
+=head3 Nesting
+
+A Nesting is, essentially, another set of parentheses.
+
+The hash for a Nesting is as follows:
+
+ {
+ type => 'Nesting',
+ args => Array of Expressions,
+ }
+
=head2 SQL clauses
These are all the legal and acceptable clauses within the AST that would