On 3/8/06, James FitzGibbon <[EMAIL PROTECTED]> wrote: > I can't find any reference to this on the PK::Auto page. In fact, the > documentation seems to point the other way: > > "load the appropriate one for your database, e.g. PK::Auto::SQLite, in your > table classes" > > "for example, if you have different databases and need to determine the > appropriate PK::Auto class at runtime" >
In the stable releases on CPAN that is still true (0.0500x). There is a seperate branch of new development called "DBIx-Class-current" which has a number of improvements, but which hasn't stabilized enough for an official release. One of those improvements is that you just use the component "PK::Auto", and the database-specific part is worked out for you by DBIx::Class internally, based on the storage subclass, which is in turn based on the DBI driver in your dsn string. > unixbeard wrote Class::DBI::BaseDSN, which tried to do this, but I'm not > sure if it's technique would be compatible with C3. It inspected the DSN, > took the DBD out, loaded Class::DBI::$DSN and then re-wrote @ISA to replace > Class::DBI::BaseDSN with Class::DBI::$DSN. > > If this works in C3, it would require calling Class::C3::reinitialize. I > think it's this manipulation of @ISA at runtime that is screwing me up. I > did a test with my problematic code, having SPE::DBIx::Class load the > PK::Auto::Oracle component at compile time and commenting out my load a > runtime bits. Now, the correct insert method is called. > > I just realized that I'm still using C3 0.09, so I'm going to upgrade to > 0.11 and see if that fixes things. IIRC, 0.05007 requires C3 0.11, so this may be your immediate problem. It can't hurt in any case. -- 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/
