UPDATE finished. Example provided.
[dbsrgits/SQL-Abstract-2.0-ish.git] / lib / SQL / Abstract / Manual / Specification.pod
index 23ea0b1..2e2fdbc 100644 (file)
@@ -327,14 +327,8 @@ 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,
-  }
+There is no specific operator or nodetype for nesting. Instead, nesting is
+explicitly specified by node descent in the AST. 
 
 =head2 SQL clauses
 
@@ -433,8 +427,8 @@ The hash for an Operator within a tables clause will be composed as follows:
   }
 
 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
 
@@ -446,11 +440,15 @@ A where clause is composed of an Expression.
 
 This corresponds to the SET clause in an INSERT or UPDATE statement.
 
-A set clause is composed as follows:
+A set clause unit is an array of one or more SetComponent units.
 
-  SetComponent := Identifier = Expression
+The hash for SetComponent unit is composed as follows:
 
-  SetComponent [ , SetComponent ]*
+  {
+      type => 'SetComponent',
+      col  => Identifier,
+      value => Expression,
+  }
 
 =head3 columns
 
@@ -467,7 +465,7 @@ A columns clause is an IdentifierList and the unit is composed as follows:
 
 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,
@@ -481,50 +479,77 @@ equal to the number of entries in the columns clause.
 
 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.
+
+The hash for a OrderbyComponent unit is composed as follows:
 
-  OrderByComponent := XXX-TODO-XXX
-  OrderByDirection := ASC | DESC
+  {
+      type  => 'OrderbyComponent',
+      value => < Identifier | Number >
+      dir   => '< ASC | DESC >',
+  }
 
-  OrderByComponent [ OrderByDirection ]
-  [ , OrderByComponent [ OrderByDirection ] ]*
+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:
 
-  GroupByComponent [ , GroupByComponent ]*
+  {
+      type  => 'GroupbyComponent',
+      value => < Identifier | Number >
+  }
+
+The number corresponds to a column in the select clause.
 
 =head3 rows
 
 This corresponds to the clause that is used in some RDBMS engines to limit the
 number of rows returned by a query. In MySQL, this would be the LIMIT clause.
 
-A rows clause is composed as follows:
+The hash for a rows clause is composed as follows:
+
+  {
+      start => Number,
+      count => Number,
+  }
 
-  Number [, Number ]
+The start attribute, if ommitted, will default to 0. The count attribute is
+optional.
 
 =head3 for
 
 This corresponds to the clause that is used in some RDBMS engines to indicate
 what locks are to be taken by this SELECT statement.
 
-A for clause is composed as follows:
+The hash for a for clause is composed as follows:
 
-  UPDATE | DELETE
+  {
+      value => '< UPDATE | DELETE >',
+  }
 
 =head3 connectby
 
 This corresponds to the clause that is used in some RDBMS engines to provide for
 an adjacency-list query.
 
-A connectby clause is composed as follows:
+The hash for a for clause is composed as follows:
+
+  {
+      start_with => ExpressionList,
+      connect_by => {
+          option => '< PRIOR | NOCYCLE >'
+          cond   => ExpressionList,
+      },
+      order_siblings => orderby-clause,
+  }
 
-  Identifier, WhereExpression
+Both the start_with and order_siblings clauses are optional.
 
 =head1 TODO