X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema.pm;h=aaf8e9f8a729c1b7ad865043b015138beefd6691;hb=16c5f7d3b5daa2d4796aee2e2ac30d5a5f931b05;hp=d35b21116f7b5800f288eda21151f85f8f3c2305;hpb=04786a4c19fe3964002b69e8a3dbb291524e0610;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index d35b211..aaf8e9f 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -169,6 +169,12 @@ For example: sub sources { return keys %{shift->source_registrations}; } +=head2 storage + + my $storage = $schema->storage; + +Returns the L object for this Schema. + =head2 resultset =over 4 @@ -425,6 +431,26 @@ sub setup_connection_class { $target->connection(@info); } +=head2 storage_type + +=over 4 + +=item Arguments: $storage_type + +=item Return Value: $storage_type + +=back + +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. Defaults to C<::DBI>, +which is L. + +You want to use this to hardcoded 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>. + =head2 connection =over 4 @@ -640,13 +666,17 @@ sub clone { =over 4 -=item Arguments: $moniker, \@data; +=item Arguments: $source_name, \@data; =back -Populates the source registered with the given moniker with the supplied data. -@data should be a list of listrefs -- the first containing column names, the -second matching values. +Pass this method a resultsource name, and an arrayref of +arrayrefs. The arrayrefs should contain a list of column names, +followed by one or many sets of matching data for the given columns. + +Each set of data is inserted into the database using +L, and a arrayref of the resulting row +objects is returned. i.e., @@ -694,7 +724,7 @@ sub throw_exception { =over 4 -=item Arguments: $sqlt_args +=item Arguments: $sqlt_args, $dir =back @@ -710,9 +740,9 @@ produced include a DROP TABLE statement for each table created. =cut sub deploy { - my ($self, $sqltargs) = @_; + my ($self, $sqltargs, $dir) = @_; $self->throw_exception("Can't deploy without storage") unless $self->storage; - $self->storage->deploy($self, undef, $sqltargs); + $self->storage->deploy($self, undef, $sqltargs, $dir); } =head2 create_ddl_dir (EXPERIMENTAL) @@ -731,8 +761,7 @@ across all databases, or fully handle complex relationships. =cut -sub create_ddl_dir -{ +sub create_ddl_dir { my $self = shift; $self->throw_exception("Can't create_ddl_dir without storage") unless $self->storage; @@ -748,8 +777,7 @@ intended for direct end user use. =cut -sub ddl_filename -{ +sub ddl_filename { my ($self, $type, $dir, $version) = @_; my $filename = ref($self); @@ -770,4 +798,3 @@ Matt S. Trout You may distribute this code under the same terms as Perl itself. =cut -