fix docs typo
[dbsrgits/DBIx-Class.git] / t / run / 12pg.tl
CommitLineData
0567538f 1sub run_tests {
2
3my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_PG_${_}" } qw/DSN USER PASS/};
4
5#warn "$dsn $user $pass";
6
7plan skip_all, 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test'
8 unless ($dsn && $user);
9
10plan tests => 1;
11
12DBICTest::Schema->compose_connection('PgTest' => $dsn, $user, $pass);
13
14my $dbh = PgTest::Artist->storage->dbh;
15
16eval {
17 $dbh->do("DROP TABLE artist;");
18};
19
20$dbh->do("CREATE TABLE artist (artistid serial PRIMARY KEY, name VARCHAR(255));");
21
22PgTest::Artist->load_components('PK::Auto::Pg');
23
24my $new = PgTest::Artist->create({ name => 'foo' });
25
26ok($new->artistid, "Auto-PK worked");
27
28}
29
301;