From: Matt S Trout Date: Mon, 23 Sep 2019 01:40:07 +0000 (+0000) Subject: extract setop rendering to a method X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b5f4a8690d2fdce1eb714c6551d9fb421605b354;p=scpubgit%2FQ-Branch.git extract setop rendering to a method --- diff --git a/lib/SQL/Abstract/ExtraClauses.pm b/lib/SQL/Abstract/ExtraClauses.pm index b5f15d9..341d9da 100644 --- a/lib/SQL/Abstract/ExtraClauses.pm +++ b/lib/SQL/Abstract/ExtraClauses.pm @@ -101,13 +101,8 @@ sub apply_to { $self->render_aqt($setop); })); - $sqla->renderer($_ => $self->cb(sub { - my ($self, $setop, $args) = @_; - $self->join_query_parts( - ' '.$self->format_keyword(join '_', $setop, ($args->{type}||())).' ', - @{$args->{queries}} - ); - })) for qw(union intersect except); + $sqla->renderer($_ => $self->cb('_render_setop')) + for qw(union intersect except); my $setop_expander = $self->cb(sub { my ($self, $setop, $args) = @_; @@ -338,4 +333,12 @@ sub _render_with { ); } +sub _render_setop { + my ($self, $setop, $args) = @_; + $self->join_query_parts( + ' '.$self->format_keyword(join '_', $setop, ($args->{type}||())).' ', + @{$args->{queries}} + ); +} + 1;