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