4 my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_PG_${_}" } qw/DSN USER PASS/};
6 #warn "$dsn $user $pass";
8 plan skip_all, 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test'
9 . ' (note: creates and drops a table named artist!)' unless ($dsn && $user);
13 DBICTest::Schema->compose_connection('PgTest' => $dsn, $user, $pass);
15 my $dbh = PgTest::Artist->storage->dbh;
17 $dbh->do("CREATE TABLE artist (artistid serial PRIMARY KEY, name VARCHAR(255));");
19 PgTest::Artist->load_components('PK::Auto::Pg');
21 my $new = PgTest::Artist->create({ name => 'foo' });
23 is($new->artistid, 1, "Auto-PK worked");
25 $new = PgTest::Artist->create({ name => 'bar' });
27 is($new->artistid, 2, "Auto-PK worked");
29 $dbh->do("DROP TABLE artist;");