[Catalyst-commits] r10157 - in trunk/Catalyst-Model-DBIC-Schema:
lib/Catalyst/Model/DBIC/Schema/Role
t/lib/TestAppC3Fail/Schema t/lib/TestAppC3Fail/Schema/DB
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Thu May 14 15:31:41 GMT 2009
Author: caelum
Date: 2009-05-14 15:31:40 +0000 (Thu, 14 May 2009)
New Revision: 10157
Added:
trunk/Catalyst-Model-DBIC-Schema/t/lib/TestAppC3Fail/Schema/DB/
trunk/Catalyst-Model-DBIC-Schema/t/lib/TestAppC3Fail/Schema/DB/Users.pm
Modified:
trunk/Catalyst-Model-DBIC-Schema/lib/Catalyst/Model/DBIC/Schema/Role/Replicated.pm
Log:
C::M::DBIC::Schema - make replicated role work with older DBIC, sort of
Modified: trunk/Catalyst-Model-DBIC-Schema/lib/Catalyst/Model/DBIC/Schema/Role/Replicated.pm
===================================================================
--- trunk/Catalyst-Model-DBIC-Schema/lib/Catalyst/Model/DBIC/Schema/Role/Replicated.pm 2009-05-14 15:21:56 UTC (rev 10156)
+++ trunk/Catalyst-Model-DBIC-Schema/lib/Catalyst/Model/DBIC/Schema/Role/Replicated.pm 2009-05-14 15:31:40 UTC (rev 10157)
@@ -43,6 +43,17 @@
C<1> by default, meaning that you have the same chance of reading from master as
you do from replicants. Set to C<0> to turn off reads from master.
+=head1 NOTE ON L<DBIx::Class> VERSIONS PRIOR TO 0.08103
+
+This role will work, however, any C<::Storage::Replicated> options in
+L<Catalyst::Model::DBIC::Schema/connect_info> will be ignored, master
+connect_info will not be merged to replicants, and
+L<DBIx::Class::Storage::DBI::Replicated::Balancer::First> will be used instead,
+with all your reads going only to one of your replicants. You'll also get some
+warnings. The C<Caching> role will also not work.
+
+Please upgrade.
+
=head1 CONFIG PARAMETERS
=head2 replicants
@@ -82,7 +93,7 @@
after finalize => sub {
my $self = shift;
- $self->storage->connect_replicants($self->replicants->flatten);
+ $self->storage->connect_replicants(map [ $_ ], $self->replicants->flatten);
};
=head1 SEE ALSO
Added: trunk/Catalyst-Model-DBIC-Schema/t/lib/TestAppC3Fail/Schema/DB/Users.pm
===================================================================
--- trunk/Catalyst-Model-DBIC-Schema/t/lib/TestAppC3Fail/Schema/DB/Users.pm (rev 0)
+++ trunk/Catalyst-Model-DBIC-Schema/t/lib/TestAppC3Fail/Schema/DB/Users.pm 2009-05-14 15:31:40 UTC (rev 10157)
@@ -0,0 +1,13 @@
+package TestAppC3Fail::Schema::DB::Users;
+
+# empty schemas no longer work
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class';
+
+__PACKAGE__->load_components("Core");
+__PACKAGE__->table("users");
+
+1;
More information about the Catalyst-commits
mailing list