[Dbix-class] DBIx::Class::Candy

fREW Schmidt frioux at gmail.com
Wed Jul 21 05:21:44 GMT 2010


Hello all,

I am proud to announce the initial, development version of
DBIx::Class::Candy, which should be coming to a CPAN mirror near you very
soon.  If you just can't wait, use cpanf (
http://search.cpan.org/perldoc?App::CPAN::Fresh) to get it *right now*.  The
basic gist of it is that you can use:

 package MyApp::Schema::Result::Artist;

 use DBIx::Class::Candy;

 table 'artists';

 column id =3D> {
   data_type =3D> 'int',
   is_auto_increment =3D> 1,
 };

 column name =3D> {
   data_type =3D> 'varchar',
   size =3D> 25,
   is_nullable =3D> 1,
 };

 primary_key 'id';

 has_many albums =3D> 'A::Schema::Result::Album', 'artist_id';

 1;

instead of

 package MyApp::Schema::Result::Artist;

 use strict;
 use warnings;
 use base 'DBIx::Class::Core';

 __PACKAGE__->table('artists');

 __PACKAGE__->add_columns(
   id =3D> {
     data_type =3D> 'int',
     is_auto_increment =3D> 1,
   },
   name =3D> {
     data_type =3D> 'varchar',
     size =3D> 25,
     is_nullable =3D> 1,
   }
 );

 __PACKAGE__->set_primary_key('id');

 __PACKAGE__->has_many( albums =3D> 'A::Schema::Result::Album', 'artist_id'=
 );

 1;

There are a few other features, like having it turn on 5.10 or 5.12
features, use a non standard base, and more.  Check it out now! (
http://search.cpan.org/perldoc?DBIx::Class::Candy)

-- =

fREW Schmidt
http://blog.afoolishmanifesto.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20100721/884=
f3d35/attachment.htm


More information about the DBIx-Class mailing list