1 use DBIx::Class::Optional::Dependencies -skip_all_without => qw( icdt _rdbms_msaccess_common );
12 my @tdeps = qw( test_rdbms_msaccess_odbc test_rdbms_msaccess_ado );
13 plan skip_all => 'Test needs ' . (join ' OR ', map
14 { "[ @{[ DBIx::Class::Optional::Dependencies->req_missing_for( $_ ) ]} ]" }
17 { DBIx::Class::Optional::Dependencies->req_ok_for( $_ ) }
21 my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_MSACCESS_ODBC_${_}" } qw/DSN USER PASS/};
22 my ($dsn2, $user2, $pass2) = @ENV{map { "DBICTEST_MSACCESS_ADO_${_}" } qw/DSN USER PASS/};
25 [ $dsn, $user || '', $pass || '' ],
26 [ $dsn2, $user2 || '', $pass2 || '' ],
29 for my $connect_info (@connect_info) {
30 my ($dsn, $user, $pass) = @$connect_info;
34 my $schema = DBICTest::Schema->connect($dsn, $user, $pass, {
35 on_connect_call => 'datetime_setup',
39 my $guard = Scope::Guard->new(sub { cleanup($schema) });
41 try { local $^W = 0; $schema->storage->dbh->do('DROP TABLE track') };
42 $schema->storage->dbh->do(<<"SQL");
44 trackid AUTOINCREMENT PRIMARY KEY,
47 last_updated_at DATETIME
51 ok(my $dt = DateTime->new({
60 ok(my $row = $schema->resultset('Track')->create({
61 last_updated_at => $dt,
64 ok($row = $schema->resultset('Track')
65 ->search({ trackid => $row->trackid }, { select => ['last_updated_at'] })
68 is($row->last_updated_at, $dt, "DATETIME roundtrip" );
76 # have to reconnect to drop a table that's in use
77 if (my $storage = eval { $schema->storage }) {
80 $storage->dbh->do('DROP TABLE track');