extract expand_bind to a method
Matt S Trout [Mon, 1 Apr 2019 04:19:02 +0000 (04:19 +0000)]
lib/SQL/Abstract.pm

index eab0be1..1c87122 100644 (file)
@@ -198,7 +198,7 @@ sub new {
     -and => '_expand_op_andor',
     -or => '_expand_op_andor',
     -nest => '_expand_nest',
-    -bind => sub { shift; +{ @_ } },
+    -bind => '_expand_bind',
     -in => '_expand_in',
     -not_in => '_expand_in',
     -row => '_expand_row',
@@ -1059,6 +1059,11 @@ sub _expand_nest {
   return $self->_expand_expr($v);
 }
 
+sub _expand_bind {
+  my ($self, $op, $bind) = @_;
+  return { $op => $bind };
+}
+
 sub _recurse_where {
   my ($self, $where, $logic) = @_;