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 my $user = $ENV{DBICTEST_MSSQL_ODBC_USER} || '';
17 my $password = $ENV{DBICTEST_MSSQL_ODBC_PASS} || '';
19 if( !$dsn || !$user ) {
20 plan skip_all => 'You need to set the DBICTEST_MSSQL_ODBC_DSN, _USER, and _PASS environment variables';
26 my $dbh = DBI->connect($dsn, $user, $password, {
27 RaiseError => 1, PrintError => 0
30 eval { $dbh->do('DROP TABLE [test.dot]') };
32 CREATE TABLE [test.dot] (
33 id INT IDENTITY NOT NULL PRIMARY KEY,
43 { use_namespaces => 1 },
44 [ $dsn, $user, $password, ]
48 ok !$@, 'table name with . parsed correctly';
51 #system qq{$^X -pi -e 's/"test\.dot"/\\\\"[test.dot]"/' t/_common_dump/TestSL/Schema/Result/TestDot.pm};
52 #diag do { local ($/, @ARGV) = (undef, "t/_common_dump/TestSL/Schema/Result/TestDot.pm"); <> };
53 #do "t/_common_dump/TestSL/Schema/Result/TestDot.pm";
55 eval 'use TestSL::Schema';
56 ok !$@, 'loaded schema';
60 local $TODO = q{this is really a DBIC test to check if the table is usable,
61 and it doesn't work in the released version yet};
64 my $rs = TestSL::Schema->resultset('TestDot');
65 my $row = $rs->create({ dat => 'foo' });
66 $row->update({ dat => 'bar' });
67 $row = $rs->find($row->id);
70 ok !$@, 'used table from DBIC succeessfully';
76 $dbh->do('DROP TABLE [test.dot]');