package My::Table; use base 'My::Class::DBI'; __PACKAGE__->table('blah'); __PACKAGE__->columns( All => qw/ foo bar baz quid quux / ); __PACKAGE__->columns( Essential => qw/ foo bar / ); __PACKAGE__->columns( Primary => 'foo' ); # assuming we have another table called 'other'.. # this creates a method called sql_method_name __PACKAGE__->set_sql( method_name => qq( select b.foo, b.bar, o.summat, o.summat_else from blah b left join other o using(foo) where b.quid=?)); sub public_method_name { my ($class,$quid) = @_; my $sth = $class->sql_method_name(); $sth->execute($quid); return @{$sth->fetchall_arrayref({})}; }