When I try to dump database with Fixtures:
dbic-migration --schema_class App::Schema --database PostgreSQL -Ilib dump_all_sets
I got error:
DBIx::Class::Schema::source(): Can't find source for Schet at /home/xxx/lib/perl5/x86_64-linux/Moose/Meta/Method/Delegation.pm line 110
In main application I have no problem to write:
$schema->resultset('Schet')
How to fix this error and dump data into fixtures?
in the DBIx::Class::Schema::Loader we are connecting to the temporary schema.
When connection occur the schema is cloned
But because of there only schema name is passed nothing is cloned and, as result, has empty class mapping. Which is wrong.
If you look carefully you will see that cloning occur twice: here and here. This extra cloning is wasteful and should be refactored.
As work around here should be passed reblessed into required namespace cloned schema:
UPD
Lately, when new loader is created, the
naming
is forced tocurrent
instead of passed argument, which, in its turn, is cloned from application schema. (I do not check that, but when application will have its ownnaming
, this will cause problems when dumping data) and loader is invoked again. Here loader loads classes based on table names instead of package names( how it is done at__PACKAGE__->load_namespaces( ... )
)Finally
@to_register
lists differ:Here
Here: