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-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=260e0f29059f53f8486828f67a1eafc60863d38a;p=scpubgit%2FQ-Branch.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({