or => $self->can('_recurse_where'),
map { +"$_" => $self->can("_$_") } qw/
value
- name
+ identifier
true
false
expr
return join(' ', @output);
}
+ method _update(AST $ast) {
+
+ for (qw/columns values tablespec/) {
+ confess "'$_' is required in update AST with " . dump ($ast)
+ unless exists $ast->{$_};
+ }
+
+ }
+
method _join(HashRef $ast) {
# TODO: Validate join type
return $output;
}
- method _name(AST $ast) {
- my @names = @{$ast->{args}};
+ method _identifier(AST $ast) {
+ my @names = @{$ast->{elements}};
- my $sep = $self->name_separator;
+ my $sep = $self->ident_separator;
my $quote = $self->is_quoting
? $self->quote_chars
: [ '' ];
my ($lhs, $rhs) = @{$ast->{args}};
my $op = $ast->{op};
+ # IS NOT? NULL
+ if ($rhs->{-type} eq 'value' && !defined $rhs->{value} &&
+ ($op eq '==' || $op eq '!='))
+ {
+ return $self->_expr($lhs) .
+ ($op eq '==' ? " IS " : " IS NOT ") .
+ "NULL";
+ }
+
join (' ', $self->_expr($lhs),
$self->binop_mapping($op) || croak("Unknown binary operator $op"),
$self->_expr($rhs)