(no commit message)
[dbsrgits/DBIx-Class.git] / t / bindtype_columns.t
CommitLineData
6e399b4f 1use strict;
2use warnings;
3
4use Test::More;
5use lib qw(t/lib);
6use DBICTest;
7
8my $schema = DBICTest->init_schema();
9
10plan tests => 2;
11
12# figure out if we've got a version of sqlite that is older than 3.2.6, in
13# which case COUNT(DISTINCT()) doesn't work
14my $is_broken_sqlite = 0;
15my ($sqlite_major_ver,$sqlite_minor_ver,$sqlite_patch_ver) =
16 split /\./, $schema->storage->dbh->get_info(18);
17if( $schema->storage->dbh->get_info(17) eq 'SQLite' &&
18 ( ($sqlite_major_ver < 3) ||
19 ($sqlite_major_ver == 3 && $sqlite_minor_ver < 2) ||
20 ($sqlite_major_ver == 3 && $sqlite_minor_ver == 2 && $sqlite_patch_ver < 6) ) ) {
21 $is_broken_sqlite = 1;
22}
23
24
25#Bindtest
26{
27 my $new = $schema->resultset("Artist")->new({
28
29 artistid=>25,
30 name=>'JohnNapiorkowski',
31 });
32
33 $new->update_or_insert;
34
35 my $resultset = $schema->resultset("Artist")->find({artistid=>25});
36
37 is($resultset->id, 25, 'Testing New ID');
38 is($resultset->name, 'JohnNapiorkowski', 'Testing New Name');
39}
40
41