3 my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_PG_${_}" } qw/DSN USER PASS/};
5 #warn "$dsn $user $pass";
7 plan skip_all, 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test'
8 . ' (note: creates and drops a table named artist!)' unless ($dsn && $user);
12 DBICTest::Schema->compose_connection('PgTest' => $dsn, $user, $pass);
14 my $dbh = PgTest::Artist->storage->dbh;
16 $dbh->do("CREATE TABLE artist (artistid serial PRIMARY KEY, name VARCHAR(255));");
18 PgTest::Artist->load_components('PK::Auto::Pg');
20 my $new = PgTest::Artist->create({ name => 'foo' });
22 is($new->artistid, 1, "Auto-PK worked");
24 $new = PgTest::Artist->create({ name => 'bar' });
26 is($new->artistid, 2, "Auto-PK worked");
28 $dbh->do("DROP TABLE artist;");