1 package make_dbictest_db;
7 eval { require DBD::SQLite };
8 my $class = $@ ? 'SQLite2' : 'SQLite';
10 my $fn = './t/dbictest.db';
13 our $dsn = "dbi:$class:dbname=$fn";
14 my $dbh = DBI->connect($dsn);
18 fooid INTEGER PRIMARY KEY,
19 footext TEXT DEFAULT 'footext',
20 foodt TIMESTAMP DEFAULT CURRENT_TIMESTAMP
23 barid INTEGER PRIMARY KEY,
24 fooref INTEGER REFERENCES foo(fooid)
26 q|INSERT INTO foo (fooid, footext) VALUES (1,'Foo text for number 1')|,
27 q|INSERT INTO foo (fooid, footext) VALUES (2,'Foo record associated with the Bar with barid 3')|,
28 q|INSERT INTO foo (fooid, footext) VALUES (3,'Foo text for number 3')|,
29 q|INSERT INTO foo (fooid, footext) VALUES (4,'Foo text for number 4')|,
30 q|INSERT INTO bar VALUES (1,4)|,
31 q|INSERT INTO bar VALUES (2,3)|,
32 q|INSERT INTO bar VALUES (3,2)|,
33 q|INSERT INTO bar VALUES (4,1)|,