Revision history for Perl extension Catalyst::Model::DBIC::Schema
+ - make sure storage_type class is loaded before ->isa check in
+ Replicated trait (RT#65791)
- fix regex stringification test for perl 5.14 (RT#68098)
+ - update connect_info POD (RT#66010)
0.48 Thu Dec 9 21:08:33 UTC 2010
- fix usage of Try::Tiny in helper
script/myapp_create.pl model CatalystModelName DBIC::Schema \
MyApp::SchemaClass create=static dbi:SQLite:foo.db \
AutoCommit=1 cursor_class=DBIx::Class::Cursor::Cached \
- on_connect_do='["select 1", "select 2"]' quote_char='"'
-
-If using a 2 character quote_char:
-
- script/myapp_create.pl ... quote_char='[]'
+ on_connect_do='["select 1", "select 2"]' quote_names=1
B<ON WINDOWS COMMAND LINES QUOTING RULES ARE DIFFERENT>
script/myapp_create.pl model CatalystModelName DBIC::Schema \
MyApp::SchemaClass create=static dbi:SQLite:foo.db \
AutoCommit=1 cursor_class=DBIx::Class::Cursor::Cached \
- on_connect_do="[\"select 1\", \"select 2\"]" quote_char="\""
+ on_connect_do="[\"select 1\", \"select 2\"]" quote_names=1
Same, but with extra Schema::Loader args (separate multiple values by commas):
script/myapp_create.pl model FilmDB DBIC::Schema MyApp::Schema::FilmDB \
create=static dbi:mysql:filmdb dbusername dbpass \
- quote_char='`' name_sep='.'
+ quote_names=1
If you are unfamiliar with L<DBIx::Class>, see L<DBIx::Class::Manual::Intro>
first.
=head2 connect_info
-This is an arrayref of connection parameters, which are specific to your
-C<storage_type> (see your storage type documentation for more details).
-If you only need one parameter (e.g. the DSN), you can just pass a string
-instead of an arrayref.
+This is a hashref or arrayref of connection parameters, which are specific to
+your C<storage_type> (see your storage type documentation for more details). If
+you only need one parameter (e.g. the DSN), you can just pass a string.
This is not required if C<schema_class> already has connection information
-defined inside itself (which isn't highly recommended, but can be done)
+defined inside itself (which isn't highly recommended, but can be done.)
For L<DBIx::Class::Storage::DBI>, which is the only supported
C<storage_type> in L<DBIx::Class> at the time of this writing, the
user postgres
password ""
auto_savepoint 1
- quote_char """
+ quote_names 1
on_connect_do some SQL statement
on_connect_do another SQL statement
</connect_info>
LongReadLen: 1000000
LongTruncOk: 1
on_connect_call: 'datetime_setup'
- quote_char: '"'
+ quote_names: 1
The old arrayref style with hashrefs for L<DBI> then L<DBIx::Class> options is also
supported:
"DBIx::Class::Storage$storage_type"
: $storage_type;
+ Class::MOP::load_class($class);
+
croak "This storage_type cannot be used with replication"
unless $class->isa('DBIx::Class::Storage::DBI::Replicated');
} else {
sub _pass_options_to_resultset {
my ($self, $source, $args) = @_;
- my @attributes = map {
- $_->init_arg || ()
- } $self->meta->get_all_attributes;
-
- my %attributes;
- @attributes{@attributes} = ();
-
for my $opt (keys %$args) {
- if (not exists $attributes{$opt}) {
- my $rs_class = $self->schema->source($source)->resultset_class;
- next unless $rs_class->can($opt);
- $rs_class->$opt($args->{$opt});
- }
+ my $rs_class = $self->schema->source($source)->resultset_class;
+ next unless $rs_class->can($opt);
+ $rs_class->$opt($args->{$opt});
}
}