From: Rob Kinyon Date: Sun, 29 Mar 2009 03:06:26 +0000 (-0400) Subject: UPDATE finished. Example provided. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=753e226d4b2b5ebaaeff6889cb8d2c8ed0f707cd;p=dbsrgits%2FSQL-Abstract-2.0-ish.git UPDATE finished. Example provided. --- diff --git a/lib/SQL/Abstract/Manual/Examples.pod b/lib/SQL/Abstract/Manual/Examples.pod index a9760be..4f69af8 100644 --- a/lib/SQL/Abstract/Manual/Examples.pod +++ b/lib/SQL/Abstract/Manual/Examples.pod @@ -405,6 +405,33 @@ one. The SQL used is from the MySQL dialect. ], } +=item * UPDATE foo SET col1 = 1 + + { + type => 'update', + ast_version => 0.0001, + tables => { + type => 'TableIdentifier', + value => { + type => 'Identifier', + element1 => 'foo', + }, + }, + set => [ + { + type => 'SetComponent', + col => { + type => 'Identifier, + element1 => 'col1', + }, + value => { + type => 'Number', + value => 1, + }, + }, + ], + } + =back =head1 AUTHORS diff --git a/lib/SQL/Abstract/Manual/Specification.pod b/lib/SQL/Abstract/Manual/Specification.pod index f9e1f32..2e2fdbc 100644 --- a/lib/SQL/Abstract/Manual/Specification.pod +++ b/lib/SQL/Abstract/Manual/Specification.pod @@ -440,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 @@ -511,7 +515,6 @@ number of rows returned by a query. In MySQL, this would be the LIMIT clause. The hash for a rows clause is composed as follows: { - type => 'Rows', start => Number, count => Number, }