Revision history for Perl extension Catalyst::Model::DBIC::Schema
+ - conversion to Moose (of Model, helper to follow)
+ - cursor caching support (via role)
- switch to hashref connect_info for DBIC 8100
- better helper option parsing
- pass loader opts to dynamic schemas
- - cursor caching support for model
0.23 Sun Mar 8 20:30:02 GMT 2009
- Kill a couple of warnings (one due to MRO::Compat)
0.04 Mon Feb 13 04:22:49 UTC 2006
- First public release
-
-0.23 2009-03-04 18:18:11
=head1 SYNOPSIS
script/create.pl model CatalystModelName DBIC::Schema MyApp::SchemaClass \
- [ create=dynamic | create=static ] [ Schema::Loader opts ] \
- [ dsn user pass ] [ other connect_info arguments ]
+ [ create=dynamic | create=static ] [ roles=role1,role2... ] \
+ [ Schema::Loader opts ] [ dsn user pass ] \
+ [ other connect_info args ]
=head1 DESCRIPTION
adapt itself to changes in your database structure. You can edit
the generated classes by hand to refine them.
+C<roles> is the list of roles to apply to the model, see
+L<Catalyst::Model::DBIC::Schema> for details.
+
+C<Schema::Loader opts> are described in L</TYPICAL EXAMPLES> below.
+
C<connect_info> arguments are the same as what
DBIx::Class::Schema::connect expects, and are storage_type-specific.
For DBI-based storage, these arguments are the dsn, username,
$self->helper($helper);
my $create = '';
- if ($args[0] && $args[0] =~ /^create=(dynamic|static)$/) {
+ if ($args[0] && $args[0] =~ /^create=(dynamic|static)\z/) {
$create = $1;
shift @args;
+ if ($args[0] && $args[0] =~ /^roles=(.*)\z/) {
+ $helper->{roles} = '['
+ .(join ',' => map { qq{'$_'} } (split /,/ => $1))
+ .']';
+ shift @args;
+ }
+
if (@args) {
$self->_parse_loader_args(\@args);
Brandon L Black, C<blblack@gmail.com>
+Contributors:
+
+Rafael Kitover, C<<rkitover at cpan.org>>
+
=head1 LICENSE
This library is free software, you can redistribute it and/or modify
__PACKAGE__->config(
schema_class => '[% schema_class %]',
+ [% IF roles %]roles => [% roles %],[% END %]
[% IF setup_connect_info %]connect_info => {
[%- FOREACH key = connect_info.keys %]
[% key %] => [% connect_info.${key} %],
=cut
-class_has 'composed_schema' => (is => 'rw');
+class_has 'composed_schema' => (is => 'rw', isa => 'DBIx::Class::Schema');
-has 'schema' => (is => 'rw');
+has 'schema' => (is => 'rw', isa => 'DBIx::Class::Schema');
has 'schema_class' => (
is => 'ro',
required => 1
);
-has 'storage_type' => (is => 'ro');
+has 'storage_type' => (is => 'ro', isa => 'Str');
has 'connect_info' => (is => 'ro', isa => ConnectInfo, coerce => 1);
# ref $self changes to anon after roles are applied, and _original_class_name is
-# broken in MX::O::P
+# broken in MX::O::P 0.0009
has '_class_name' => (is => 'ro', isa => 'ClassName', default => sub {
ref shift
});
-has 'model_name' => (is => 'ro', default => sub {
+has 'model_name' => (is => 'ro', isa => 'Str', default => sub {
my $self = shift;
my $class = ref $self;
Brandon L Black, C<blblack@gmail.com>
+Contributors:
+
+Rafael Kitover, C<<rkitover at cpan.org>>
+
=head1 COPYRIGHT
This program is free software, you can redistribute it and/or modify it
$c->model('DB::Table')->search({ foo => 'bar' }, { cache_for => 18000 });
-=bead1 CONFIG PARAMETERS
+=head1 CONFIG PARAMETERS
=over 4
+++ /dev/null
-use Test::More;
-
-eval "use Test::Pod::Coverage 1.04";
-plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@;
-plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
-
-all_pod_coverage_ok();
+++ /dev/null
-use Test::More;
-
-eval { require Test::Kwalitee; Test::Kwalitee->import() };
-
-plan( skip_all => 'Test::Kwalitee not installed; skipping' ) if $@;