X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest.pm;h=e4768a07b33fa040c06aeeba35aa0f217f3d07e5;hb=64d48e1989b06ff4cdb33eb7b16846d511168c64;hp=d09a9dc3264cbea08db86f2ae28a29e050a25098;hpb=e48635f7178f8527ec3cc230f1cf869e8876dc39;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/lib/DBICTest.pm b/t/lib/DBICTest.pm index d09a9dc..e4768a0 100644 --- a/t/lib/DBICTest.pm +++ b/t/lib/DBICTest.pm @@ -32,7 +32,7 @@ use DBICTest::Util qw( ); use DBICTest::Util::LeakTracer qw/populate_weakregistry assert_empty_weakregistry/; use DBICTest::Schema; -use DBIx::Class::_Util qw( detected_reinvoked_destructor scope_guard ); +use DBIx::Class::_Util qw( detected_reinvoked_destructor scope_guard modver_gt_or_eq ); use Carp; use Fcntl qw/:DEFAULT :flock/; use Config; @@ -374,8 +374,19 @@ sub init_schema { if ( !$args{no_connect} ) { $schema->connection(@dsn); - $schema->storage->connect_replicants(\@dsn) - if $ENV{DBICTEST_VIA_REPLICATED}; + if( $ENV{DBICTEST_VIA_REPLICATED} ) { + + # add explicit ReadOnly=1 if we can support it + $dsn[0] =~ /^dbi:SQLite:/i + and + require DBD::SQLite + and + modver_gt_or_eq('DBD::SQLite', '1.49_05') + and + $dsn[0] =~ s/^dbi:SQLite:/dbi:SQLite(ReadOnly=1):/i; + + $schema->storage->connect_replicants(\@dsn); + } } if ( !$args{no_deploy} ) {