From: Matt S Trout Date: Thu, 21 Mar 2019 05:08:58 +0000 (+0000) Subject: re-engineer ident X-Git-Tag: v2.000000~3^2~371 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=181ae15053f90b5553e88d0d6c24db0d49defb8d;p=dbsrgits%2FSQL-Abstract.git re-engineer ident --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index ee02d63..5c2b71c 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -200,6 +200,14 @@ sub new { 'not between' => '_expand_between', 'in' => '_expand_in', 'not in' => '_expand_in', + 'ident' => sub { + my ($self, $op, $arg, $k) = @_; + return +{ -op => [ + $self->{cmp}, + $self->_expand_ident(-ident => $k), + $self->_expand_expr({ '-'.$op => $arg }), + ] }; + }, }; $opt{render} = { @@ -686,13 +694,6 @@ sub _expand_expr_hashpair { if (my $x = $self->{expand_op}{$op}) { return $self->$x($op, $vv, $k); } - if ($op eq 'ident') { - return +{ -op => [ - $self->{cmp}, - $self->_expand_ident(-ident => $k), - $self->_expand_expr({ -ident => $vv }), - ] }; - } if ($op eq 'value') { return $self->_expand_expr({ $k, undef }) unless defined($vv); return +{ -op => [