tag:blogger.com,1999:blog-36345871.post8851235830319709215..comments2023-07-11T05:39:57.966-07:00Comments on Perl Alchemy - notes of a programmer: DBIx::Class gotchaszbyhttp://www.blogger.com/profile/04636763782334128869noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-36345871.post-994779583026483522008-10-09T06:38:00.000-07:002008-10-09T06:38:00.000-07:00Helpful?http://search.cpan.org/~ash/DBIx-Class-0.0...Helpful?<BR/>http://search.cpan.org/~ash/DBIx-Class-0.08010/lib/DBIx/Class/Manual/Cookbook.pod#Arbitrary_SQL_through_a_custom_ResultSourceAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-36345871.post-10432190146390323792008-08-29T06:31:00.000-07:002008-08-29T06:31:00.000-07:00Thanks, Zbignew. It is not exactly clear how well ...Thanks, Zbignew. <BR/><BR/>It is not exactly clear how well does this fix improves things for the case we observe here, but it's hopeful.ivan kurmanovhttps://www.blogger.com/profile/15266899077910715841noreply@blogger.comtag:blogger.com,1999:blog-36345871.post-45428086281681159162008-08-28T07:51:00.000-07:002008-08-28T07:51:00.000-07:00Hi Kurmanov - unfortunately I cannot answer your q...Hi Kurmanov - unfortunately I cannot answer your question. This is what the author chosen - but fortunately it seems that he improved it a bit lately (see the update to the article above).zbyhttps://www.blogger.com/profile/04636763782334128869noreply@blogger.comtag:blogger.com,1999:blog-36345871.post-60934527576985511222008-08-28T03:49:00.000-07:002008-08-28T03:49:00.000-07:00> Column values in DBIC are kept in a hash - th...> Column values in DBIC are kept in a hash - this means that a column can have some defined value, have undefined value or can be completely non-existent - and DBIC interprets all of those states differently. When $row->some_relation is called and ->some_relation uses a foreign key column that is non-existent then the result is currently random (and in the future most probably an exception will be raised). <BR/><BR/>Why shouldn't it return undef for undefined and uninitialized column values? Is it because that may happen in a number of different circumstances?ivan kurmanovhttps://www.blogger.com/profile/15266899077910715841noreply@blogger.comtag:blogger.com,1999:blog-36345871.post-24539275090339611682008-06-18T02:59:00.000-07:002008-06-18T02:59:00.000-07:00I made the switch to DBIx::Class for a refactoring...I made the switch to DBIx::Class for a refactoring project where the old code was using raw sql all over the shop and using a custom db library.<BR/><BR/>It's both easier to use and more efficient, and I'm happy to drop down to SQL - it's just a matter of grabbing the schema object and calling a search against a resultset, or grabbing a db handle if you need to do something directly.<BR/><BR/>I still miss CDBI's ability to add custom sql more easily - DBIx::Class requires subclassing, where as CDBI allowed you to specify a named query for a relation, search or even store/retrieve.<BR/><BR/>Over all though, I've learnt that even if the ORM can do something, you shouldn't be afraid of doing it yourself.Anonymousnoreply@blogger.com