8 $DUMP_DIR = './t/_common_dump';
12 use DBIx::Class::Schema::Loader 'make_schema_at', "dump_to_dir:$DUMP_DIR";
15 my $dsn = $ENV{DBICTEST_MSSQL_ODBC_DSN} ||
16 $ENV{DBICTEST_MSSQL_DSN} || '';
18 my $user = $ENV{DBICTEST_MSSQL_ODBC_USER} ||
19 $ENV{DBICTEST_MSSQL_USER} || '';
21 my $password = $ENV{DBICTEST_MSSQL_ODBC_PASS} ||
22 $ENV{DBICTEST_MSSQL_PASS} || '';
24 if( !$dsn || !$user ) {
26 'You need to set the DBICTEST_MSSQL_ODBC_DSN (or DBICTEST_MSSQL_DSN), _USER,' .
27 ' and _PASS environment variables';
33 my $dbh = DBI->connect($dsn, $user, $password, {
34 RaiseError => 1, PrintError => 0
37 eval { $dbh->do('DROP TABLE [loadertest.dot]') };
39 CREATE TABLE [loadertest.dot] (
40 id INT IDENTITY NOT NULL PRIMARY KEY,
52 constraint => qr/^loadertest\.dot\z/
54 [ $dsn, $user, $password, ]
58 ok !$@, 'table name with . parsed correctly';
61 #system qq{$^X -pi -e 's/"test\.dot"/\\\\"[loadertest.dot]"/' t/_common_dump/TestSL/Schema/Result/TestDot.pm};
62 #diag do { local ($/, @ARGV) = (undef, "t/_common_dump/TestSL/Schema/Result/TestDot.pm"); <> };
63 #do "t/_common_dump/TestSL/Schema/Result/TestDot.pm";
65 eval 'use TestSL::Schema';
66 ok !$@, 'loaded schema';
70 local $TODO = q{this is really a DBIC test to check if the table is usable,
71 and it doesn't work in the released version yet};
74 my $rs = TestSL::Schema->resultset('LoadertestDot');
75 my $row = $rs->create({ dat => 'foo' });
76 $row->update({ dat => 'bar' });
77 $row = $rs->find($row->id);
80 ok !$@, 'used table from DBIC succeessfully';
86 $dbh->do('DROP TABLE [loadertest.dot]');