8 my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_MSSQL_${_}" } qw/DSN USER PASS/};
10 #warn "$dsn $user $pass";
12 plan skip_all => 'Set $ENV{DBICTEST_MSSQL_DSN}, _USER and _PASS to run this test'
17 DBICTest::Schema->storage_type('::DBI::MSSQL');
18 DBICTest::Schema->compose_connection( 'MSSQLTest' => $dsn, $user, $pass );
20 my $dbh = MSSQLTest->schema->storage->dbh;
22 $dbh->do("IF OBJECT_ID('artist', 'U') IS NOT NULL
25 $dbh->do("CREATE TABLE artist (artistid INT IDENTITY PRIMARY KEY, name VARCHAR(255));");
27 MSSQLTest::Artist->load_components('PK::Auto::MSSQL');
30 my $new = MSSQLTest::Artist->create( { name => 'foo' } );
31 ok($new->artistid, "Auto-PK worked");
35 MSSQLTest::Artist->create( { name => 'Artist ' . $_ } );
38 my $it = MSSQLTest::Artist->search( { },
41 order_by => 'artistid'
45 is( $it->count, 3, "LIMIT count ok" );
46 ok( $it->next->name, "iterator->next ok" );
49 is( $it->next, undef, "next past end of resultset ok" );