Revision history for Perl extension DBIx::Class::Schema::Loader
0.03001 XXX not yet released
+ - load_from_connection deprecation notice now mentions
+ upgrading Catalyst::Model::DBIC::Schema if that module
+ seems to be in use.
- DBIx::Class required version number fixed
- Loader statement caching for better load-time performance
- Improved Pg unique index loader, based on RDBO
setting up the columns and primary keys.
DBIx::Class::Schema::Loader currently supports DBI for MySQL,
-Postgres, SQLite and DB2.
+PostgreSQL, SQLite and DB2.
See L<DBIx::Class::Schema::Loader::DBI::Writing> for notes on writing
your own vendor-specific subclass for an unsupported DBD driver.
This simple function allows one to create a Loader-based schema
in-memory on the fly without any on-disk class files of any
kind. When used with the C<dump_directory> option, you can
-use this to generate a rought draft manual schema from a dsn
+use this to generate a rough draft manual schema from a dsn
without the intermediate step of creating a physical Loader-based
schema class.
This deprecated method is now roughly an alias for L</loader_options>.
-This method *will* dissappear in a future version.
+This method *will* disappear in a future version.
For now, using this method will invoke the legacy behavior for
backwards compatibility, and merely emit a warning about upgrading
sub load_from_connection {
my ($self, %args) = @_;
+
+ my $cmds_ver = $Catalyst::Model::DBIC::Schema::VERSION;
+ if($cmds_ver) {
+ if($cmds_ver < 0.14) {
+ warn 'You should upgrade your installation of'
+ . ' Catalyst::Model::DBIC::Schema to 0.14 or higher, then:';
+ }
+ warn 'You should regenerate your Model files, which may eliminate'
+ . ' the following deprecation warning:';
+ }
warn 'load_from_connection deprecated, please [re-]read the'
- . ' [new] DBIx::Class::Schema::Loader documentation';
+ . ' [new] DBIx::Class::Schema::Loader documentation';
# Support the old connect_info / dsn / etc args...
$args{connect_info} = [
If you're already using C<loader> in your code, make an effort
to get rid of it. If you think you've found a situation where it
-is neccesary, let me know and we'll see what we can do to remedy
+is necessary, let me know and we'll see what we can do to remedy
that situation.
In some future version, this accessor *will* disappear. It was
Currently the loader is limited to working within a single schema
(using the database vendors' definition of "schema"). If you
have a multi-schema database with inter-schema relationships (which
-is easy to do in Postgres or DB2 for instance), you only get to
+is easy to do in PostgreSQL or DB2 for instance), you only get to
automatically load the tables of one schema, and any relationships
to tables in other schemas will be silently ignored.
=head2 moniker_map
-Overrides the default tablename -> moniker translation. Can be either
-a hashref of table => moniker names, or a coderef for a translator
+Overrides the default table name to moniker translation. Can be either
+a hashref of table keys and moniker values, or a coderef for a translator
function taking a single scalar table name argument and returning
a scalar moniker. If the hash entry does not exist, or the function
returns a false value, the code falls back to default behavior
=head2 resultset_components
-List of additional resultset components to be loaded into your table
+List of additional ResultSet components to be loaded into your table
classes. A good example would be C<AlwaysRS>. Component
C<ResultSetManager> will be automatically added to the above
C<components> list if this option is set.
=head2 legacy_default_inflections
Setting this option changes the default fallback for L</inflect_plural> to
-utilize L<Lingua::EN::Inflect/PL>, and L</inflect_singlular> to a no-op.
-Those choices produce substandard results, but might be neccesary to support
+utilize L<Lingua::EN::Inflect/PL>, and L</inflect_singular> to a no-op.
+Those choices produce substandard results, but might be necessary to support
your existing code if you started developing on a version prior to 0.03 and
don't wish to go around updating all your relationship names to the new
defaults.
manual version of itself. This might be a really good or bad thing
depending on your situation and perspective.
-Normally you wouldn't hardcode this setting in your schema class, as it
+Normally you wouldn't hard-code this setting in your schema class, as it
is meant for one-time manual usage.
See L<DBIx::Class::Schema::Loader/dump_to_dir> for examples of the
=head2 monikers
-Returns a hashref of loaded table-to-moniker mappings. There will
+Returns a hashref of loaded table to moniker mappings. There will
be two entries for each table, the original name and the "normalized"
name, in the case that the two are different (such as databases
that like uppercase table names, or preserve your original mixed-case
=head2 classes
-Returns a hashref of table-to-classname mappings. In some cases it will
+Returns a hashref of table to class mappings. In some cases it will
contain multiple entries per table for the original and normalized table
names, as above in L</monikers>.
# Override this for uniq info
sub _table_uniq_info {
- warn "No UNIQUE information can be gathered for this vendor";
+ warn "No UNIQUE constraint information can be gathered for this vendor";
return [];
}
=head1 NAME
-DBIx::Class::Schema::Loader::DBI::Pg - DBIx::Class::Schema::Loader::DBI Postgres Implementation.
+DBIx::Class::Schema::Loader::DBI::Pg - DBIx::Class::Schema::Loader::DBI
+PostgreSQL Implementation.
=head1 SYNOPSIS
}
if(!@col_names) {
- warn "Failed to parse unique constraint $indexname on $table";
+ warn "Failed to parse UNIQUE constraint $indexname on $table";
}
else {
push(@uniqs, [ $indexname => \@col_names ]);
],
# ...
}
-
+
You might want to use this in building an on-disk source class file, by
adding each string to the appropriate source class file,
prefixed by C<__PACKAGE__-E<gt>>.