On Fri Sep 14 06:46:29 2012, STEVENL wrote:
Show quoted text> There is no option to supply database connection options.
>
I should probably extend the class to do this natively. At $ork we use TDCS and have a similar issue. The approach here is slightly different:
package SchemaTest;
use Test::DBIx::Class::Schema 0.01013;
use base 'Test::DBIx::Class::Schema';
use Test::More;
use FooBar::Database;
sub new {
my ($proto, $options) = @_;
if (exists $options->{dsn_from}) {
my $params = FooBar::Database::db_connect_params(
{ name => $options->{dsn_from}, }
);
$options->{dsn} = FooBar::Database::_connection_string( $params );
$options->{username} = $params->{db_user} || undef;
$options->{password} = $params->{db_pass} || undef;
$options->{test_missing} =
defined $options->{fail_on_missing}
? delete $options->{fail_on_missing}
: 1;
}
my $self = Test::DBIx::Class::Schema::new($proto, $options);
return $self;
}
1;
Yeah, I know, horrible ... it's worked so long I've never needed to revisit this.