Commit | Line | Data |
c6d74d3e |
1 | package # hide from PAUSE |
2 | DBICTest::Plain; |
50041f3c |
3 | |
4 | use strict; |
5 | use warnings; |
1752dc15 |
6 | use base qw/DBIx::Class::Schema/; |
50041f3c |
7 | use DBI; |
8 | |
9 | my $db_file = "t/var/Plain.db"; |
10 | |
11 | unlink($db_file) if -e $db_file; |
12 | unlink($db_file . "-journal") if -e $db_file . "-journal"; |
13 | mkdir("t/var") unless -d "t/var"; |
14 | |
15 | my $dsn = "dbi:SQLite:${db_file}"; |
16 | |
fc69fea6 |
17 | __PACKAGE__->load_classes("Test"); |
50041f3c |
18 | my $schema = __PACKAGE__->compose_connection(__PACKAGE__, $dsn); |
19 | |
20 | my $dbh = DBI->connect($dsn); |
21 | |
22 | my $sql = <<EOSQL; |
23 | CREATE TABLE test ( |
24 | id INTEGER NOT NULL, |
25 | name VARCHAR(32) NOT NULL |
26 | ); |
27 | |
28 | INSERT INTO test (id, name) VALUES (1, 'DBIC::Plain is broken!'); |
29 | |
30 | EOSQL |
31 | |
32 | $dbh->do($_) for split(/\n\n/, $sql); |
33 | |
34 | 1; |