Before anyone else responds with technical information, I'll say I had
exactly the same reaction and it is part of what took me a long time to
migrate to DBIC from CDBI. There are many, many gains from the
resultset oriented approach and once you get the hang of it there's
little to miss about CDBI (except in very simple set-ups that won't
grow).
DBIC apps are harder to set up and slightly more verbose but they
(generally) never back you into corners that create mountains of
spaghetti to get around.
-Ashley
On Monday, Oct 30, 2006, at 12:37 US/Pacific, Mike Friedman wrote:
Greetings,
I'm used to Class::DBI and very new to DBIx::Class.
>From the docs, it seems like to execute any search, I have to
1. Instantiate a schema object and connect it
2. Call $schema->resultset('MyTableClass')->search( ... );
In Class::DBI, since the table classes generally inherit from the main
DB class, I can just call MyTableClass->search( ... ) which seems a
lot simpler. (And less to type.)
Is there a similar way to achieve this simpler syntax with
DBIx::Class, or do I have to use $schema->resultset every time?
Is there a recommended way to encapsulate connection parameters, so I
don't have to call $schema->connect all over the place?
(Note: I'm not trying to be obnoxious, I just don't really quite
understand how DBIC is organized just yet.)
Thanks,
Mike
_______________________________________________
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]/