add, expand, and use in from, VALUES
[dbsrgits/SQL-Abstract.git] / lib / SQL / Abstract.pm
index 1220d85..e68fdaf 100644 (file)
@@ -209,6 +209,7 @@ sub new {
     ident => '_expand_ident',
     value => '_expand_value',
     func => '_expand_func',
+    values => '_expand_values',
   };
 
   $opt{expand_op} = {
@@ -1048,6 +1049,17 @@ sub _expand_bind {
   return { -bind => $bind };
 }
 
+sub _expand_values {
+  my ($self, undef, $values) = @_;
+  return { -values => [
+    map +(
+      ref($_) eq 'HASH'
+        ? $_
+        : +{ -row => [ map $self->expand_expr($_), @$_ ] }
+    ), @$values
+  ] };
+}
+
 sub _recurse_where {
   my ($self, $where, $logic) = @_;