Simple work on update errors
[dbsrgits/SQL-Abstract-2.0-ish.git] / lib / SQL / Abstract / Compat.pm
index ea74a1a..af08032 100644 (file)
@@ -67,7 +67,7 @@ class SQL::Abstract::Compat {
     );
     $args{quote_chars} = $self->quote_char
       if $self->has_quote_chars;
-    $args{name_sep} = $self->name_sep
+    $args{ident_separator} = $self->name_sep
       if $self->has_name_sep;
 
     # TODO: this needs improving along with SQL::A::create
@@ -80,10 +80,23 @@ class SQL::Abstract::Compat {
   {
     my $ast = $self->select_ast($from,$fields,$where,$order);
 
-    $DB::single = 1;
     return ($self->visitor->dispatch($ast), @{$self->visitor->binds});
   }
 
+  method update(Str|ArrayRef|ScalarRef $from,   
+                HashRef $fields, WhereType $where? )
+  {
+    my $ast = $self->update_ast($from,$fields,$where);
+
+    return ($self->visitor->dispatch($ast), @{$self->visitor->binds});
+  }
+
+  method update_ast(Str|ArrayRef|ScalarRef $from,   
+                    HashRef $fields, WhereType $where? ) 
+  {
+    return { -type => 'update' };
+  }
+
   method select_ast(Str|ArrayRef|ScalarRef $from, ArrayRef|Str $fields,
                 WhereType $where?,
                 WhereType $order?)
@@ -131,7 +144,7 @@ class SQL::Abstract::Compat {
     @names = split /\Q@{[$self->name_sep]}\E/, $names[0]
       if (@names == 1 && $self->has_name_sep);
 
-    my $ast = { -type => 'name', args => [ @names ] };
+    my $ast = { -type => 'identifier', elements => [ @names ] };
 
     return $ast
       unless $use_convert && $self->has_field_convertor;