sub join_query_parts {
my ($self, $join, @parts) = @_;
+ my @final = map +(ref($_) eq 'HASH' ? [ $self->render_aqt($_) ] : $_),
+ @parts;
return (
- join($join, map $_->[0], @parts),
- (wantarray ? (map @{$_}[1..$#$_], @parts) : ()),
+ join($join, map $_->[0], @final),
+ (wantarray ? (map @{$_}[1..$#$_], @final) : ()),
);
}
foreach my $clause (@{$self->{clauses_of}{$type}}) {
next unless my $clause_expr = $args->{$clause};
local $self->{convert_where} = $self->{convert} if $clause eq 'where';
- my ($sql) = my @part = do {
+ my @part = do {
if (my $rdr = $self->{render_clause}{"${type}.${clause}"}) {
$self->$rdr($clause, $clause_expr);
} else {
($sql, @bind);
}
};
- next unless defined($sql) and length($sql);
push @parts, \@part;
}
my ($sql, @bind) = $self->join_query_parts(' ', @parts);