I agree with you, using DBIx for simple stuff is fine, but after a while raw SQL is sometimes nice to have.
I cant figure out how to return the data in object form, but this will at least give you some data: __PACKAGE__->load_components(qw/ ResultSetManager PK::Auto Core /); sub get_data : ResultSet { my ($self) = @_; my $dbh = $self->result_source->schema->storage->dbh; ## use the handle, return data } http://search.cpan.org/~JROBINSON/DBIx-Class-0.07005/lib/DBIx/Class/Manual/Cookbook.pod#Predefined_searches_without_writing_a_ResultSet_class But this is not so useful if you cant return it in object form. (Want to be able to call functions/associations on that object). CDBI does it with sth_to_objects, and there is a CDBI compatibility layer, but I cant seem to get it working correctly. John On 5/22/07, Adam Bartosik <[EMAIL PROTECTED]> wrote:
> What would that achieve that passing literal SQL chunks for SELECT, FROM, > WHERE etc. wouldn't? Readability. Complex SQL statements are more clear to understand than complex dbix "statements" when you are not an author of DBIX ;) I can also test it with simple copy&paste to sql console to see how it works, how it is planned / optimized. I know it is ORM and database abstraction, I'm theoretically independent from my DB vendor and so on, but it doesn't change the fact it is more complicated, more "noise", more "strange" -opt { qw[col1 col2] } than pure SQL statement. And when all this Catalyst/Dbix stuff is so flexible - why I should fight with such approach? -- [EMAIL PROTECTED] http://www.hurra-communications.com/ $ o m e t e a m . d e v e l o p e r Hurra Communications, Krakow/Stuttgart/London/Paris/Madrid _______________________________________________ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
_______________________________________________ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/