The 'as' component of an Alias is now an Identifier
Rob Kinyon [Fri, 3 Apr 2009 18:18:10 +0000 (14:18 -0400)]
lib/SQL/Abstract/Manual/Examples.pod
lib/SQL/Abstract/Manual/Specification.pod

index a98e890..651134c 100644 (file)
@@ -39,7 +39,10 @@ one. The SQL used is from the MySQL dialect.
                   type     => 'Function',
                   function => 'NOW',
               },
-              as => 'time',
+              as => {
+                  type => 'Identifier',
+                  element1 => 'time',
+              },
           },
       ],
       tables => {
@@ -48,7 +51,10 @@ one. The SQL used is from the MySQL dialect.
               type => 'Identifier',
               element1 => 'dual',
           },
-          as => 'duality',
+          as => {
+              type => 'Identifier',
+              element1 => 'duality',
+          },
       },
   }
 
@@ -447,6 +453,38 @@ one. The SQL used is from the MySQL dialect.
       },
   }
 
+=item * SELECT * FROM ( SELECT 1 ) AS foo
+
+  {
+      type => 'select',
+      ast_version => 0.0001,
+      select => [
+          {
+              type => 'Identifier',
+              element1 => '*',
+          },
+      ],
+      tables => {
+          type => 'Identifier',
+          element1 => 'foo',
+          value => {
+              type => 'select',
+              ast_version => 0.0001,
+              select => [
+                  {
+                      type    => 'Value',
+                      subtype => 'Number',
+                      value   => 1,
+                  },
+              ],
+          },
+          as => {
+              type => 'Identifier',
+              element1 => 'foo',
+          },
+      },
+  }
+
 =back
 
 =head1 AUTHORS
index ce616b7..b38ef28 100644 (file)
@@ -302,7 +302,7 @@ The hash will be structured as follows:
   {
       type  => 'Alias',
       value => Expression,
-      as    => String,
+      as    => Identifier,
   }
 
 =head3 Expression