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