[Dbix-class] Views and tables without primary keys

Christopher Laco claco at chrislaco.com
Sun Jul 6 14:56:08 BST 2008


IvorW wrote:
> I have an application that uses a view. The application uses
> DBIx::Class::Schema::Loader, and I get a warning about primary keys,
> every time I start the app. The application works fine. In fact I get
> the warning when I use a MySQL database, but not when I use sqlite.
> 
> I've traced it in the source code to DBIx::Class::Schema::Loader::Base,
> and I attach a patch which removes the warning. In theory, this warning
> might be serving some purpose if you had a genuine table that didn't
> have a primary key, but not for a view. This warning just gets in the way.

I'd say this warning should be kept if your using Loader to generate a 
static schema (files), but it should be removed if you're using a 
dynamic schema (on the fly).


-=Chris



More information about the DBIx-Class mailing list