On 4/5/07, Hartmaier Alexander <[EMAIL PROTECTED]> wrote:
You can override sub insert or use triggers if your db supports them.
Triggers gets my vote. Anything complicated that goes on with your database should be shoved down to the database layer if at all possible. It simplifies your code, and it enforces these meta-schema ideals on all other users of your database (future apps that connect to your app's database, admin tools, even you on the commandline fixing things up manually). I take the same approach with complex queries now too. If its more than a join or two, I spend some time factoring out a good manual SQL query for it, and make it into a view with a good descriptive name, and add the view to my DBIx::Class::Schema just like any other table. DBIx::Class *has* the power to do a lot of complex things at the Perl level, but that doesn't mean its always a good design decision to use it :) -- Brandon _______________________________________________ List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class Wiki: http://dbix-class.shadowcatsystems.co.uk/ IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/ Searchable Archive: http://www.mail-archive.com/[email protected]/
