6 # add some rows inside a transaction and commit it
7 # XXX: Is storage->dbh the only way to get a dbh?
8 $schema->storage->txn_begin;
10 $schema->resultset("Artist")->create( {
12 name => "artist number $_",
15 $schema->storage->txn_commit;
16 my ($artist) = $schema->resultset("Artist")->find(15);
17 is($artist->name, 'artist number 15', "Commit ok");
19 # add some rows inside a transaction and roll it back
20 $schema->storage->txn_begin;
22 $schema->resultset("Artist")->create( {
24 name => "artist number $_",
27 $schema->storage->txn_rollback;
28 ($artist) = $schema->resultset("Artist")->search( artistid => 25 );
29 is($artist, undef, "Rollback ok");
31 my $type_info = $schema->storage->columns_info_for('artist');
33 # I know this is gross but SQLite reports the size differently from release
34 # to release. At least this way the test still passes.
36 delete $type_info->{artistid}{size};
37 delete $type_info->{name}{size};
39 my $test_type_info = {
41 'data_type' => 'INTEGER',
45 'data_type' => 'varchar',
49 is_deeply($type_info, $test_type_info, 'columns_info_for - column data types');