From: Matt S Trout Date: Tue, 16 Apr 2019 03:52:42 +0000 (+0000) Subject: clean up calling code w/new render convention X-Git-Tag: v2.000000~3^2~221 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b42692a64c8ac98afd276ddbbc600d9fb89ac009;p=dbsrgits%2FSQL-Abstract.git clean up calling code w/new render convention --- diff --git a/lib/SQL/Abstract/ExtraClauses.pm b/lib/SQL/Abstract/ExtraClauses.pm index c055b8b..7c534c1 100644 --- a/lib/SQL/Abstract/ExtraClauses.pm +++ b/lib/SQL/Abstract/ExtraClauses.pm @@ -90,14 +90,15 @@ sub register_defaults { $self->render_aqt($setop); }); + $self->renderer($_ => sub { + my ($self, $setop, $args) = @_; + $self->join_clauses( + ' '.$self->format_keyword(join '_', $setop, ($args->{type}||())).' ', + map [ $self->render_aqt($_) ], @{$args->{queries}} + ); + }) for qw(union intersect except); + foreach my $setop (qw(union intersect except)) { - $self->renderer($setop => sub { - my ($self, undef, $args) = @_; - $self->join_clauses( - ' '.$self->format_keyword(join '_', $setop, ($args->{type}||())).' ', - map [ $self->render_aqt($_) ], @{$args->{queries}} - ); - }); $self->clause_expander("select.${setop}" => sub { +(setop => $_[0]->expand_expr({