On 6/29/06, Daniel McBrearty <[EMAIL PROTECTED]> wrote: > Or will Loader automatically > detect and define realationships for us?
Yes, you just have to supply the optional parameter "relationships => 1" (see perldoc DBIx::Class::Schema::Loader[::Base]), and it will load up your relationships for you. > Is this the point where we should start manually defining > relationships and throw away Loader? Especially if you're just now building your own database from scratch, it really is best to build manual schemas and then deploy to your rdbms via ->deploy, rather than the other way around (which is to write SQL CREATE TABLE statements, deploy them manually, then use Schema::Loader to create the schema). The core arguments for the former over the latter boil down to that DBIx::Class::Schema has more metadata than your SQL DDL statements have, therefore it is the preferred original source. The big use-case for the Loader in the first place is primarily people attaching to legacy databases over which they have little control or design input. An easy way to wean yourself is to use the new Schema::Loader feature to dump the schema definition to a set of static class files, and then take over manual maintenance from there (see the perldoc section on "dump_to_dir" and "make_schema_at"). This functionality is a bit clunky at the moment, but will eventually become a simple command in the dbicadmin shell (or at least that's the plan). Of course, you're free to keep using Loader all you want forever, its just probably not the best practice. in most peoples' situations. -- 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]/
