Add support for UPDATE ... RETURNING ...
[scpubgit/Q-Branch.git] / t / dbic / bulk-insert.t
CommitLineData
fda8a675 1use strict;
2use warnings;
3
4use Test::More;
aa2ae81e 5
6BEGIN {
13da332c 7 # ask for a recent DBIC version to skip the 5.6 testing as well
aa2ae81e 8 plan skip_all => 'Test temporarily requires DBIx::Class'
9 unless eval { require DBIx::Class::Storage::Statistics; DBIx::Class->VERSION('0.08124') };
13da332c 10
11 plan skip_all => 'Test does not properly work with the pre-0.082800 DBIC trials'
12 if DBIx::Class->VERSION =~ /^0.082700\d\d/;
aa2ae81e 13}
14
fda8a675 15use DBIx::Class::Storage::Debug::PrettyPrint;
16
17my $cap;
18open my $fh, '>', \$cap;
19
20my $pp = DBIx::Class::Storage::Debug::PrettyPrint->new({
21 profile => 'none',
22 fill_in_placeholders => 1,
23 placeholder_surround => [qw(' ')],
24 show_progress => 0,
25});
26
27$pp->debugfh($fh);
28
29$pp->query_start('INSERT INTO self_ref_alias (alias, self_ref) VALUES ( ?, ? )', qw('__BULK_INSERT__' '1'));
30is(
31 $cap,
c4d7cfcf 32 qq{INSERT INTO self_ref_alias( alias, self_ref ) VALUES( ?, ? ) : '__BULK_INSERT__', '1'\n},
fda8a675 33 'SQL Logged'
34);
35
36done_testing;