# test Auto-PK with different options
for my $opts (@opts) {
- $schema = DBICTest::Schema->clone;
- $schema->connection($dsn, $user, $pass, $opts);
+ SKIP: {
+ $schema = DBICTest::Schema->connect($dsn, $user, $pass, $opts);
- $schema->resultset('Artist')->search({ name => 'foo' })->delete;
+ eval {
+ $schema->storage->ensure_connected
+ };
+ if ($@ =~ /dynamic cursors/) {
+ skip
+'Dynamic Cursors not functional, tds_version 8.0 or greater required if using'.
+' FreeTDS', 1;
+ }
- $new = $schema->resultset('Artist')->create({ name => 'foo' });
- ok($new->artistid > 0, "Auto-PK worked");
+ $schema->resultset('Artist')->search({ name => 'foo' })->delete;
+
+ $new = $schema->resultset('Artist')->create({ name => 'foo' });
+
+ ok($new->artistid > 0, "Auto-PK worked");
+ }
}
$seen_id{$new->artistid}++;
SQL
});
+# start disconnected to make sure insert works on an un-reblessed storage
+$schema = DBICTest::Schema->connect($dsn, $user, $pass);
+
my $row;
lives_ok {
$row = $schema->resultset('ArtistGUID')->create({ name => 'mtfnpy' })