From: Matt S Trout Date: Mon, 1 Apr 2019 02:53:34 +0000 (+0000) Subject: rename -tuple to -row X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c206512014bb57feb7ae59d6956c6a8607b2e1c1;p=scpubgit%2FQ-Branch.git rename -tuple to -row --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 65dc204..b2ad384 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -204,7 +204,7 @@ sub new { -bind => sub { shift; +{ @_ } }, -in => '_expand_in', -not_in => '_expand_in', - -tuple => sub { + -row => sub { my ($self, $node, $args) = @_; +{ $node => [ map $self->expand_expr($_), @$args ] }; }, @@ -244,7 +244,7 @@ sub new { } $opt{render} = { - (map +("-$_", "_render_$_"), qw(op func bind ident literal tuple)), + (map +("-$_", "_render_$_"), qw(op func bind ident literal row)), %{$opt{render}||{}} }; @@ -1087,7 +1087,7 @@ sub _render_ident { return $self->_convert($self->_quote($ident)); } -sub _render_tuple { +sub _render_row { my ($self, $values) = @_; my ($sql, @bind) = $self->_render_op([ ',', @$values ]); return "($sql)", @bind; diff --git a/t/05in_between.t b/t/05in_between.t index a3e7656..9d168c4 100644 --- a/t/05in_between.t +++ b/t/05in_between.t @@ -310,9 +310,9 @@ my @in_between_tests = ( { where => { -in => [ - { -tuple => [ 'x', 'y' ] }, - { -tuple => [ 1, 2 ] }, - { -tuple => [ 3, 4 ] }, + { -row => [ 'x', 'y' ] }, + { -row => [ 1, 2 ] }, + { -row => [ 3, 4 ] }, ], }, stmt => ' WHERE (x, y) IN ((?, ?), (?, ?))',