__PACKAGE__->mk_ro_accessors(qw/
schema
- dsn
- user
- password
- options
+ connect_info
exclude
constraint
additional_classes
Available constructor options are:
+=head2 connect_info
+
+Identical to the connect_info arguments to C<connect> and C<connection>
+that are mentioned in L<DBIx::Class::Schema>.
+
+An arrayref of connection information. For DBI-based Schemas,
+this takes the form:
+
+ connect_info => [ $dsn, $user, $pass, { AutoCommit => 1 } ],
+
=head2 additional_base_classes
List of additional base classes your table classes will use.
Enable debug messages.
-=head2 dsn
-
-DBI Data Source Name.
-
-=head2 password
-
-Password.
-
=head2 relationships
Try to automatically detect/setup has_a and has_many relationships.
a hashref argument, not a coderef. If you set C<inflect> to anything,
that setting will be copied to L</inflect_map>.
+=head2 dsn
+
+DEPRECATED, use L</connect_info> instead.
+
+DBI Data Source Name.
+
=head2 user
+DEPRECATED, use L</connect_info> instead.
+
Username.
+=head2 password
+
+DEPRECATED, use L</connect_info> instead.
+
+Password.
+
+=head2 options
+
+DEPRECATED, use L</connect_info> instead.
+
+DBI connection options hashref, like:
+
+ { AutoCommit => 1 }
+
=head1 METHODS
=cut
additional_base_classes
left_base_classes
components
- resultset_components/);
+ resultset_components
+ connect_info/);
push(@{$self->{components}}, 'ResultSetManager')
if @{$self->{resultset_components}};
# Support deprecated argument name
$self->{inflect_map} ||= $self->{inflect};
+ # Support deprecated connect_info args, even mixed
+ # with a valid partially-filled connect_info
+ $self->{connect_info}->[0] ||= $self->{dsn};
+ $self->{connect_info}->[1] ||= $self->{user};
+ $self->{connect_info}->[2] ||= $self->{password};
+ $self->{connect_info}->[3] ||= $self->{options};
+
$self;
}
sub load {
my $self = shift;
- $self->schema->connection($self->dsn, $self->user,
- $self->password, $self->options);
+ $self->schema->connection(@{$self->connect_info});
warn qq/\### START DBIx::Class::Schema::Loader dump ###\n/
if $self->debug;