Start working on update clause
[dbsrgits/SQL-Abstract-2.0-ish.git] / t / 202_update.t
CommitLineData
d4656fcf 1use strict;
2use warnings;
3
4use Test::More tests => 5;
5use Test::Differences;
6
7use FindBin;
8use lib "$FindBin::Bin/lib";
9use Test::SQL::Abstract::Util qw/
10 mk_name
11 mk_value
12 mk_alias
13 :dumper_sort
14/;
15
16use_ok('SQL::Abstract') or BAIL_OUT( "$@" );
17
18my $sqla = SQL::Abstract->create(1);
19
20is $sqla->dispatch(
21 { -type => 'update',
22 tablespec => mk_name('test'),
23 columns => [
24 mk_name(qw/me id/),
25 mk_name(qw/hostname/),
26 ],
27 values => [
28 mk_expr('+', mk_name(qw/me id/), mk_value(5)),
29 mk_value('localhost'),
30 ]
31 }
32), "UPDATE test SET me.id = me.id + 5, hostnameme = localhost"
33 "update clause";