[Dbix-class] RFC: DBIx::Class::Sweet

Matt S Trout dbix-class at trout.me.uk
Mon Apr 3 14:58:43 CEST 2006


Nilson Santos Figueiredo Junior wrote:
> Well, It's a module that adds some syntatic sugar to DBIx::Class.
> Currently, it only makes the DBIx::Class subclass "setup" easier on
> the eyes but I intend to develop it further as I see fit, maybe adding
> more substancial features.
> 
> Here's what the code should look like when using it:
> 
>     package World::Person;
> 
>     use DBIx::Class::Sweet;
> 
>     setup_class {
> 
>         add_columns(qw/id name country_id/);
>         set_primary_key('id');
>         belongs_to( country => 'World::Country', 'country_id' );
> 
>     };

This sort of declarative schema setup style is something that's already been 
discussed on here and that we intend to supply as part of core DBIC once we 
have a sane implementation.

> Note that in order for it to work correctly, I actually needed to do
> things such as making the caller inherit from us manually, since I
> couldn't manage to make it work with "use base 'DBIx::Class::Sweet'".
> Any thoughts on this one would be welcome.

There are potentially better approaches, but this one is actually fairly 
reasonable.

> You can fetch it at:
> http://www.nilson.org/DBIx-Class-Sweet-0.01.tar.gz
> 
> Or you can wait for PAUSE to stop hating me and replicate it
> throughout the mirrors (whenever I upload something to CPAN directly
> from my computer, I get some weird "nosuccesscount[0] error[...An
> Error Occurred....An Error Occurred.400 FTP return code 000..]
> (paused:638)" errors).

Please DO NOT upload this to CPAN. If you have, please delete it from CPAN 
again. It is *not* worth being an add-on package.

Please rather than just releasing pointless tiny modules to CPAN will you 
consider actually talking to the development teams of the respective packages? 
There's a large number of DBIx::Class committers and I'd be happy to have you 
among them, but it'd be much nicer if you collaborated with us and discussed 
these ideas before you start shipping things to PAUSE.

> I know, I know, the name is a blatant rip-off. But I just couldn't
> think of anything better right now. So if this bothers
> Class::DBI::Sweet authors, please, tell me.

Yes, it does.

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Dbix-class mailing list