From: Matt S Trout Date: Sun, 22 Sep 2019 03:03:29 +0000 (+0000) Subject: auto-generate clause expansion config X-Git-Tag: v2.000000~3^2~132 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f2e897ae53fa0643bbf18f6fb26b23a564e79cea;p=dbsrgits%2FSQL-Abstract.git auto-generate clause expansion config --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index dcd80d1..463c6ea 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -184,10 +184,7 @@ our %Defaults = ( delete => [ qw(target where returning) ], }, expand_clause => { - 'delete.target' => '_expand_delete_clause_target', 'delete.from' => '_expand_delete_clause_target', - 'delete.where' => '_expand_delete_clause_where', - 'delete.returning' => '_expand_delete_clause_returning', }, render_clause => { 'delete.target' => '_render_delete_clause_target', @@ -197,6 +194,10 @@ our %Defaults = ( foreach my $stmt (keys %{$Defaults{clauses_of}}) { $Defaults{expand}{$stmt} = '_expand_statement'; $Defaults{render}{$stmt} = '_render_statement'; + foreach my $clause (@{$Defaults{clauses_of}{$stmt}}) { + $Defaults{expand_clause}{"${stmt}.${clause}"} + = "_expand_${stmt}_clause_${clause}"; + } } sub new {