[Dbix-class] Fwd: DBIx::Class patch: better error diagnostics

Marc Espie espie at nerim.net
Wed Dec 6 15:53:36 GMT 2006


And while you're at it, someone MAY want to amend the documentation to
DBIx::Class. Even though Matt reminded me to not send email directly to
him, I *am* working on a lot of projects, and when I do patches, I do
look at whatever information is available, quickly. The simpler the project
is set up, the more chance I'll interact with the people...

In man DBIx::Class, there are tens of lines of information, and the most
obvious is AUTHOR, with one single name. A mention of an address to report
bugs and patches to would be very useful...

Note that the META.yml also mentions Matt S. Trout.

Matt, you may not be organized, but if you don't want people to look you
up each time they write a patch or encounter a bug, well, there's one
simple way: have simple directions pointing the right direction...

On Wed, Dec 06, 2006 at 03:31:01PM +0000, Matt S Trout wrote:
> Somebody kick the tires at this and apply it if it seems sane please?
> 
> Begin forwarded message:
> 
> >From: Marc Espie <espie at nerim.net>
> >Date: 6 December 2006 15:12:15 GMT
> >To: mst at shadowcatsystems.co.uk
> >Subject: DBIx::Class patch: better error diagnostics
> >Reply-To: espie at nerim.net
> >
> >As I said in former messages, I'm (still) a novice to DBIx::Class,  
> >so I'm
> >probably qualified to comment on diagnostics ;-)
> >
> >Those two patches actually helped me set up my schema correctly  
> >(yes, they're
> >very simple).
> >
> >I've noticed that the primary key check is the same, so it probably  
> >means
> >some refactoring would help more, but those were a life-saver for me.
> >
> >--- lib/DBIx/Class/Relationship/HasMany.pm.orig	Wed Dec  6 15:56:28  
> >2006
> >+++ lib/DBIx/Class/Relationship/HasMany.pm	Wed Dec  6 15:57:00 2006
> >@@ -16,6 +16,10 @@ sub has_many {
> >       "${class} has more"
> >     ) if $too_many;
> >
> >+    $class->throw_exception(
> >+      "has_many needs a primary key to infer a join; ".
> >+      "${class} has none"
> >+    ) if !defined $pri;
> >     my ($f_key,$guess);
> >     if (defined $cond && length $cond) {
> >       $f_key = $cond;
> >--- lib/DBIx/Class/Relationship/HasOne.pm.orig	Wed Dec  6 15:57:05  
> >2006
> >+++ lib/DBIx/Class/Relationship/HasOne.pm	Wed Dec  6 15:58:09 2006
> >@@ -21,6 +21,10 @@ sub _has_one {
> >       "might_have/has_one can only infer join for a single primary  
> >key; ".
> >       "${class} has more"
> >     ) if $too_many;
> >+    $class->throw_exception(
> >+      "might_have/has_one needs a primary key  to infer a join; ".
> >+      "${class} has none"
> >+    ) if !defined $pri;
> >     my $f_class_loaded = eval { $f_class->columns };
> >     my ($f_key,$guess);
> >     if (defined $cond && length $cond) {
> 
> -- 
> Matt S Trout, Technical Director, Shadowcat Systems Ltd.
> Offering custom development, consultancy and support contracts for  
> Catalyst,
> DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for  
> details.
> + Help us build a better perl ORM: http://dbix- 
> class.shadowcatsystems.co.uk/ +
> 
> 
> 
> _______________________________________________
> List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
> Wiki: http://dbix-class.shadowcatsystems.co.uk/
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
> Searchable Archive: 
> http://www.mail-archive.com/dbix-class@lists.rawmode.org/



More information about the Dbix-class mailing list