From: Matt S Trout Date: Mon, 23 Sep 2019 02:41:43 +0000 (+0000) Subject: switch to direct from list expansion X-Git-Tag: v2.000000~3^2~113 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c319683ee9e9236059891b89041256628bfba82b;p=dbsrgits%2FSQL-Abstract.git switch to direct from list expansion --- diff --git a/lib/SQL/Abstract/ExtraClauses.pm b/lib/SQL/Abstract/ExtraClauses.pm index 22817ce..808ff0d 100644 --- a/lib/SQL/Abstract/ExtraClauses.pm +++ b/lib/SQL/Abstract/ExtraClauses.pm @@ -61,7 +61,7 @@ sub apply_to { }); $sqla->clause_expanders( - 'update.from' => $self->cb('_expand_select_clause_from'), + 'update.from' => $self->cb('_expand_from_list'), 'delete.using' => $self->cb('_expand_from_list'), 'insert.rowvalues' => $self->cb(sub { +(from => $_[0]->expand_expr({ -values => $_[2] })); @@ -111,7 +111,7 @@ sub apply_to { $sqla->expander(cast => $self->cb('_expand_cast')); $sqla->clause_expanders( - "select.from", $self->cb('_expand_select_clause_from'), + "select.from", $self->cb('_expand_from_list'), "update.target", $self->cb('_expand_update_clause_target'), "update.update", $self->cb('_expand_update_clause_target'), ); @@ -131,11 +131,6 @@ sub _expand_select { return $exp; } -sub _expand_select_clause_from { - my ($self, undef, $from) = @_; - +(from => $self->_expand_from_list(undef, $from)); -} - sub _expand_from_list { my ($self, undef, $args) = @_; if (ref($args) eq 'HASH') {