method update_ast(Str|ArrayRef|ScalarRef $from,
HashRef $fields, WhereType $where? )
{
- return { -type => 'update' };
+ my (@columns, @values);
+ my $ast = {
+ -type => 'update',
+ tablespec => $self->tablespec($from),
+ columns => \@columns,
+ values => \@values
+ };
+
+ for (keys %$fields) {
+ push @columns, $self->mk_name(0, $_);
+ push @values, { -type => 'value', value => $fields->{$_} };
+ }
+
+ return $ast;
}
method select_ast(Str|ArrayRef|ScalarRef $from, ArrayRef|Str $fields,
my $foo_eq_1 = field_op_value($foo_id, '==', 1);
my $bar_eq_str = field_op_value($bar_id, '==', 'some str');
-local $TODO = 'Work out what this should be';
eq_or_diff
$visitor->update_ast('test', { foo => 1 }),
{ -type => 'update',
tablespec => mk_name('test'),
-
+ columns => [
+ mk_name('foo')
+ ],
+ values => [
+ mk_value(1)
+ ]
},
"simple update";