1 =head1 DBIx::Class Cookbook
5 =item Input validation.
9 =item Many-to-many relationships
11 This is not as easy as it could be, but it's possible. Here's an example to
16 use base qw/DBIx::Class/;
18 __PACKAGE__->load_components(qw/Core DB/);
19 __PACKAGE__->connection(...);
25 __PACKAGE__->table('left');
26 __PACKAGE__->add_columns(qw/id left_stuff/);
27 __PACKAGE__->set_primary_key(qw/id/);
28 __PACKAGE__->has_many('mid' => 'Mid');
33 { 'left.id' => $self->id },
34 { join => { 'mid' => 'left' }});
41 __PACKAGE__->table('mid');
42 __PACKAGE__->add_columns(qw/left right/);
43 __PACKAGE__->set_primary_key(qw/left right/);
45 __PACKAGE__->belongs_to('left' => 'Left');
46 __PACKAGE__->belongs_to('right' => 'Right');
52 __PACKAGE__->table('right');
53 __PACKAGE__->add_columns(qw/id right_stuff/);
54 __PACKAGE__->set_primary_key(qw/id/);
55 __PACKAGE__->has_many('mid' => 'Mid');
60 { 'right.id' => $self->id },
61 { join => { 'mid' => 'right' });
64 =item Advanced Exception handling