I'm using Rose::DB with Postgresql 9.6. The call to ROSE::DB::Object::Loader->make_classes method fails to create any classes. I've traced it down, and found that the problem is in the line
|
unless($db->has_primary_key($table)) |
The call to $db->has_primary_key($table) returns false because no catalog was specified in the arguments to the call. If you call this method separately with a catalog argument that specifies the correct catalog the call returns true.
The failure is due to the way the Rose::DB->_get_primary_key_column_names method (which is ultimately called by has_primary_key) is written. The test below
|
next PK unless($pk_info->{'TABLE_CAT'} eq $catalog && |
will always fail if a catalog was not specified in the arguments. The Rose::DB Postgresql classes are set up so as to prevent specification of a catalog, so there is no way to specify a catalog other than passing it as an argument. Since the line in Loader->make_classes doesn't pass the catalog as an argument, all classes report that they have no primary key. Loader->make_classes skips classes that don't have a primary key.
This problem propagates down into the Rose::DB::Object::Metadata->auto_initialize method which is also called by Loader->make_classes. Even if I remove the test for catalog from the Rose::DB->_get_primary_key_column_names method, the Metadata->auto_initialize method fails.
I'm using Rose::DB with Postgresql 9.6. The call to ROSE::DB::Object::Loader->make_classes method fails to create any classes. I've traced it down, and found that the problem is in the line
rose/modules/Rose-DB-Object/lib/Rose/DB/Object/Loader.pm
Line 996 in deadf1e
The call to $db->has_primary_key($table) returns false because no catalog was specified in the arguments to the call. If you call this method separately with a catalog argument that specifies the correct catalog the call returns true.
The failure is due to the way the Rose::DB->_get_primary_key_column_names method (which is ultimately called by has_primary_key) is written. The test below
rose/modules/Rose-DB/lib/Rose/DB.pm
Line 1534 in deadf1e
will always fail if a catalog was not specified in the arguments. The Rose::DB Postgresql classes are set up so as to prevent specification of a catalog, so there is no way to specify a catalog other than passing it as an argument. Since the line in Loader->make_classes doesn't pass the catalog as an argument, all classes report that they have no primary key. Loader->make_classes skips classes that don't have a primary key.
This problem propagates down into the Rose::DB::Object::Metadata->auto_initialize method which is also called by Loader->make_classes. Even if I remove the test for catalog from the Rose::DB->_get_primary_key_column_names method, the Metadata->auto_initialize method fails.