],
},
{
- type => 'Nesting',
+ type => 'Operator',
+ op => 'OR',
args => [
{
type => 'Operator',
- op => 'OR',
+ op => '=',
+ args => [
+ {
+ type => 'Identifier',
+ element1 => 'title',
+ },
+ {
+ type => 'Value',
+ subtype => 'String',
+ element1 => 'Mr',
+ },
+ ],
+ },
+ {
+ type => 'Operator',
+ op => '=',
args => [
{
- type => 'Operator',
- op => '=',
- args => [
- {
- type => 'Identifier',
- element1 => 'title',
- },
- {
- type => 'Value',
- subtype => 'String',
- element1 => 'Mr',
- },
- ],
+ type => 'Identifier',
+ element1 => 'abbrev',
},
{
- type => 'Operator',
- op => '=',
- args => [
- {
- type => 'Identifier',
- element1 => 'abbrev',
- },
- {
- type => 'Value',
- subtype => 'String',
- element1 => 'Dr',
- },
- ],
+ type => 'Value',
+ subtype => 'String',
+ element1 => 'Dr',
},
],
},
},
}
+=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 => 'OR',
+ args => [
+ {
+ type => 'Operator',
+ op => 'AND',
+ args => [
+ {
+ type => 'Operator',
+ op => '=',
+ args => [
+ {
+ type => 'Identifier',
+ element1 => 'name',
+ },
+ {
+ type => 'Value',
+ subtype => 'String',
+ element1 => 'John',
+ },
+ ],
+ },
+ {
+ 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
=head3 Nesting
-A Nesting is, essentially, another set of parentheses.
-
-The hash for a Nesting is as follows:
-
- {
- type => 'Nesting',
- args => Array of Expressions,
- }
+There is no specific operator or nodetype for nesting. Instead, nesting is
+explicitly specified by node descent in the AST.
=head2 SQL clauses