(map +($_ => 'unop_reverse'), ('IS NULL', 'IS NOT NULL')),
(map +($_ => 'flatten'), qw(AND OR) ),
(map +($_ => 'in'), ('IN', 'NOT IN')),
- (map +($_ => 'between'), ('BETWEEN', 'NOT BETWEEN'))
+ (map +($_ => 'between'), ('BETWEEN', 'NOT BETWEEN')),
+ (apply => 'apply'),
}
}
}
sub _render_value {
- [ '?', $_[1] ];
+ defined($_[1]->{value})
+ ? [ '?', $_[1] ]
+ : [ 'NULL' ];
}
sub _operator_type { 'SQL.Naive' }
[ $lhs, $op_name, $rhs1, 'AND', $rhs2 ];
}
+sub _handle_op_type_apply {
+ my ($self, $op_name, $dq) = @_;
+ my ($func, @args) = @{$dq->{args}};
+ die "Function name must be identifier"
+ unless $func->{type} eq DQ_IDENTIFIER;
+ my $ident = $self->_render($func)->[0];
+ [
+ "$ident(",
+ (map $self->_render($_), @args),
+ ')'
+ ]
+}
+
sub _convert_op {
my ($self, $dq) = @_;
if (my $perl_op = $dq->{'operator'}->{'Perl'}) {