4 use Test::More qw(no_plan);
13 my ( $dsn, $user, $pass )
14 = @ENV{ map {"DBICTEST_PG_${_}"} qw/DSN USER PASS/ };
15 plan skip_all => <<'EOM' unless $dsn && $user;
16 Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test
17 ( NOTE: This test drops and creates some tables.')
20 my $schema = CafeInsertion->connect( $dsn, $user, $pass );
21 $schema->storage->ensure_connected;
22 $schema->storage->_use_insert_returning(0);
23 $schema->storage->dbh->{Warn} = 0;
25 my $dir = "t/sql"; # tempdir(CLEANUP => 0);
26 $schema->create_ddl_dir( ['PostgreSQL'], 0.1, $dir );
27 $schema->deploy( { add_drop_table => 1, add_drop_view => 1 } );
30 $schema->source('Sumatra'),
31 'DBIx::Class::ResultSource::View',
35 my ( $drink, $drink1 );
38 $drink = $schema->resultset('Sumatra')->create(
46 "I can call a create on a view sumatra";
49 $drink1 = $schema->resultset('Coffee')->create( { flavor => 'aaight', } );
51 "I can do it for the other view, too";
53 my $sqlt_object = $schema->{sqlt};
55 [ map { $_->name } $sqlt_object->get_views ],
61 "SQLT view order triumphantly matches our order."