X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema.pm;h=4c3a0ad690122f86fcdbfa54fbfb77eb57357ab5;hb=d88ecca6486a2b1c4b6e2f0440165b186aab39bc;hp=a7080e29ceb3f61acda9ecb38b143d4a9e5aa8c5;hpb=73d47f9f2e278359b095b9986da89988aee83a44;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index a7080e2..4c3a0ad 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -33,8 +33,9 @@ DBIx::Class::Schema - composable schemas __PACKAGE__->load_namespaces(); package Library::Schema::Result::CD; - use base qw/DBIx::Class/; - __PACKAGE__->load_components(qw/Core/); # for example + use base qw/DBIx::Class::Core/; + + __PACKAGE__->load_components(qw/InflateColumn::DateTime/); # for example __PACKAGE__->table('cd'); # Elsewhere in your code: @@ -406,12 +407,10 @@ sub load_classes { Set the storage class that will be instantiated when L is called. If the classname starts with C<::>, the prefix C is -assumed by L. +assumed by L. You want to use this to set subclasses of L -in cases where the appropriate subclass is not autodetected, such as -when dealing with MSSQL via L, in which case you'd set it -to C<::DBI::Sybase::MSSQL>. +in cases where the appropriate subclass is not autodetected. If your storage type requires instantiation arguments, those are defined as a second argument in the form of a hashref and the entire @@ -631,13 +630,13 @@ See L for more information. This interface is preferred over using the individual methods L, L, and L below. -WARNING: If you are connected with C 0> the transaction is +WARNING: If you are connected with C<< AutoCommit => 0 >> the transaction is considered nested, and you will still need to call L to write your -changes when appropriate. You will also want to connect with C -1> to get partial rollback to work, if the storage driver for your database +changes when appropriate. You will also want to connect with C<< auto_savepoint => +1 >> to get partial rollback to work, if the storage driver for your database supports it. -Connecting with C 1> is recommended. +Connecting with C<< AutoCommit => 1 >> is recommended. =cut @@ -814,7 +813,7 @@ sub connection { $storage_class = 'DBIx::Class::Storage'.$storage_class if $storage_class =~ m/^::/; - eval "require ${storage_class};"; + eval { $self->ensure_class_loaded ($storage_class) }; $self->throw_exception( "No arguments to load_classes and couldn't load ${storage_class} ($@)" ) if $@; @@ -910,7 +909,7 @@ sub compose_namespace { no strict 'refs'; no warnings 'redefine'; foreach my $meth (qw/class source resultset/) { - *{"${target}::${meth}"} = + *{"${target}::${meth}"} = Sub::Name::subname "${target}::${meth}" => sub { shift->schema->$meth(@_) }; } }