From: Matt S Trout Date: Sun, 22 Sep 2019 03:03:29 +0000 (+0000) Subject: auto-generate clause expansion config X-Git-Tag: v1.90_01~111 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=36e706a20a54a8e429d7078a26417e1ffab427ef;p=dbsrgits%2FSQL-Abstract.git auto-generate clause expansion config --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 79df3d8..92a2b8b 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 {