=head1 NAME
-DBIx::Class::Test::SQLite - Base class for DBIx::Class tests, shamelessly ripped from Class::DBI::Test::SQLite
+DBIx::Class::Test::SQLite - Base class for running Class::DBI tests against DBIx::Class compat layer, shamelessly ripped from Class::DBI::Test::SQLite
=head1 SYNOPSIS
use strict;
-use base 'DBIx::Class';
+use base qw/DBIx::Class/;
+
+__PACKAGE__->load_components(qw/CDBICompat PK::Auto::SQLite Core DB/);
+
use File::Temp qw/tempfile/;
my (undef, $DB) = tempfile();
END { unlink $DB if -e $DB }
-my @DSN = ("dbi:SQLite:dbname=$DB", '', '', { AutoCommit => 1 });
+my @DSN = ("dbi:SQLite:dbname=$DB", '', '', { AutoCommit => 1, RaiseError => 1 });
__PACKAGE__->connection(@DSN);
__PACKAGE__->set_sql(_table_pragma => 'PRAGMA table_info(__TABLE__)');
sub _create_test_table {
my $class = shift;
- my @vals = $class->sql__table_pragma->select_row;
- $class->sql__create_me($class->create_sql)->execute unless @vals;
+ my @vals = $class->sql__table_pragma->select_row;
+ $class->sql__create_me($class->create_sql)->execute unless @vals;
+# my @vals = $class->_sql_to_sth(
+# 'PRAGMA table_info(__TABLE__)')->select_row;
+# $class->_sql_to_sth(
+# 'CREATE TABLE '.$class->table.' ('.$class->create_sql.')'
+# )->execute unless @vals;
}
=head2 create_sql (abstract)