[Dbix-class] RFC: DBIx::Class::Schema::Declare

Nilson Santos Figueiredo Junior acid06 at gmail.com
Mon Apr 3 20:44:08 CEST 2006


On 4/3/06, Sebastian Riedel <sri at oook.de> wrote:
>      use DBIx::Class::Schema::Declare [
>
>          One => {
>              foo => { primary => 1 },
>              bar => 'text',
>          }, { table => 'three' },
>
>          Two => {
>              baz => { primary    => 1 },
>              qux => { type       => 'text', length => 23, null => 0 },
>              one => { belongs_to => 'One' }
>          }
>
>      ];


Consider:

  table {
    class 'One';
    column 'foo', -primary => 1;
    column 'bar', Text();
  }

  table {
    class 'Two';
    column 'baz', -primary => 1;
    column 'qux', Text(23), -not_null => 1;
    belongs_to 'one';
  }

It really surprises me if that's your notion of "elegantness". I think
you have a rather wicked notion of what's elegant or not. But probably
it's just me.

-Nilson Santos F. Jr.



More information about the Dbix-class mailing list