X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader.pm;h=47b666b54d46669548b35251928f905889e12fb0;hb=b97c2c1e790cc4c18370238fd98eddac4e7de2d8;hp=bbc8fd31071d4bc1d1213de86507a479af7a5ed6;hpb=e8ad6491c9e520ef034a1f94e702e660d5c5959c;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/lib/DBIx/Class/Schema/Loader.pm b/lib/DBIx/Class/Schema/Loader.pm index bbc8fd3..47b666b 100644 --- a/lib/DBIx/Class/Schema/Loader.pm +++ b/lib/DBIx/Class/Schema/Loader.pm @@ -17,6 +17,7 @@ our $VERSION = '0.03999_01'; __PACKAGE__->mk_classaccessor('dump_to_dir'); __PACKAGE__->mk_classaccessor('_loader_args' => {}); __PACKAGE__->mk_classaccessor('_loader_invoked'); +__PACKAGE__->mk_classaccessor('_loader'); =head1 NAME @@ -111,7 +112,8 @@ sub _invoke_loader { croak qq/Could not load storage_type loader "$impl": / . qq/"$UNIVERSAL::require::ERROR"/; - $impl->new(%$args)->load; + $self->_loader($impl->new(%$args)); + $self->_loader->load; $self->_loader_invoked(1); $self; @@ -284,6 +286,16 @@ sub make_schema_at { $target->connection(@$connect_info); } +=head2 rescan + +Re-scans the database for newly added tables since the initial +load, and adds them to the schema at runtime, including relationships, +etc. Does not process drops or changes. + +=cut + +sub rescan { shift->_loader->rescan } + =head1 EXAMPLE Using the example in L as a basis