sub _expand_op {
my ($self, undef, $args) = @_;
my ($op, @opargs) = @$args;
+ if (my $exp = $self->{expand_op}{$op}) {
+ return $self->$exp($op, \@opargs);
+ }
+{ -op => [ $op, map $self->expand_expr($_), @opargs ] };
}
my $opened_sql = $self->_open_outer_paren($sql);
return +{ -op => [
$op, $self->expand_expr($k, -ident),
- [ { -literal => [ $opened_sql, @bind ] } ]
+ { -literal => [ $opened_sql, @bind ] }
] };
}
my $undef_err =
return +{ -op => [
$op,
$self->expand_expr($k, -ident),
- \@rhs
+ @rhs
] };
}
sub _render_op_in {
my ($self, $op, $args) = @_;
- my ($lhs, $rhs) = @$args;
+ my ($lhs, @rhs) = @$args;
my @in_bind;
my @in_sql = map {
my ($sql, @bind) = $self->render_aqt($_);
push @in_bind, @bind;
$sql;
- } @$rhs;
+ } @rhs;
my ($lhsql, @lbind) = $self->render_aqt($lhs);
return (
$lhsql.' '.$self->_sqlcase(join ' ', split '_', $op).' ( '
bind => [],
test => 'Top level -is ok',
},
+ {
+ where => { -op => [ in => x => 1, 2, 3 ] },
+ stmt => ' WHERE x IN (?, ?, ?)',
+ bind => [ 1, 2, 3 ],
+ test => 'Raw -op passes through correctly'
+ },
+
);
for my $case (@in_between_tests) {