From: Rob Kinyon Date: Sun, 29 Mar 2009 03:23:19 +0000 (-0400) Subject: Added example of DELETE X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=da93022e1bbced169a169c4ba777bf2ff4418a77;p=dbsrgits%2FSQL-Abstract-2.0-ish.git Added example of DELETE --- diff --git a/lib/SQL/Abstract/Manual/Examples.pod b/lib/SQL/Abstract/Manual/Examples.pod index 1080cc1..52b4500 100644 --- a/lib/SQL/Abstract/Manual/Examples.pod +++ b/lib/SQL/Abstract/Manual/Examples.pod @@ -23,7 +23,7 @@ one. The SQL used is from the MySQL dialect. type => 'SelectComponent', value => { type => 'Value', - subtype => 'number', + subtype => 'Number', value => 1, }, }, @@ -68,7 +68,7 @@ one. The SQL used is from the MySQL dialect. type => 'SelectComponent', value => { type => 'Value', - subtype => 'number', + subtype => 'Number', value => 1, }, }, @@ -384,21 +384,24 @@ one. The SQL used is from the MySQL dialect. { type => 'GroupbyComponent', value => { - type => 'Number', + type => 'Value', + subtype => 'Number', value => 1, }, }, { type => 'GroupbyComponent', value => { - type => 'Number', + type => 'Value', + subtype => 'Number', value => 3, }, }, { type => 'GroupbyComponent', value => { - type => 'Number', + type => 'Value', + subtype => 'Number', value => 2, }, }, @@ -425,7 +428,8 @@ one. The SQL used is from the MySQL dialect. element1 => 'col1', }, value => { - type => 'Number', + type => 'Value', + subtype => 'Number', value => 1, }, }, @@ -456,16 +460,47 @@ one. The SQL used is from the MySQL dialect. ], values => [ { - type => 'Number, + type => 'Value', + subtype => 'Number', value => '1', }, { - type => 'Number, + type => 'Value', + subtype => 'Number', value => '3', }, ], } +=item * DELETE FROM foo WHERE col1 = 10 + + { + type => 'delete', + ast_version => 0.0001, + tables => { + type => 'TableIdentifier', + value => { + type => 'Identifier', + element1 => 'foo', + }, + }, + where => { + type => 'Operator', + op => '=', + args => [ + { + type => 'Identifier', + element1 => 'col1', + }, + { + type => 'Value', + subtype => 'Number', + value => 10, + }, + ], + }, + } + =back =head1 AUTHORS diff --git a/lib/SQL/Abstract/Manual/Specification.pod b/lib/SQL/Abstract/Manual/Specification.pod index 77d4e72..c201c51 100644 --- a/lib/SQL/Abstract/Manual/Specification.pod +++ b/lib/SQL/Abstract/Manual/Specification.pod @@ -205,8 +205,8 @@ be careful to I quote asterisks. =head3 Value -A Value is a Perl scalar. Depending on the type, a Visitor may be able to make -certain decisions. +A Value is a Perl scalar. Depending on the subtype, a Visitor may be able to +make certain decisions. The following are the minimally-valid subtypes: =over 4