1 package Catalyst::Helper::Model::DBIC::Schema;
9 Catalyst::Helper::Model::DBIC::Schema - Helper for DBIC Schema Models
13 script/create.pl model Foo DBIC::Schema Foo::SchemaClass [ connect_info arguments ]
16 Foo is the short name for the Model class being generated
17 Foo::SchemaClass is the fully qualified classname of your Schema,
18 which isa DBIx::Class::Schema defined elsewhere.
19 connect_info arguments are the same as what DBIx::Class::Schema::connect
20 expects, and are storage_type-specific. For DBI-based storage, these
21 arguments are the dsn, username, password, and connect options,
24 =head1 TYPICAL EXAMPLES
26 script/myapp_create.pl model Foo DBIC::Schema FooSchema dbi:mysql:foodb myuname mypass '{ AutoCommit => 1 }'
28 # -or, if the schema already has connection info and you want to re-use that:
29 script/myapp_create.pl model Foo DBIC::Schema FooSchema
33 Helper for the DBIC Schema Models.
42 my ( $self, $helper, $schema_class, @connect_info) = @_;
44 $helper->{schema_class} = $schema_class || '';
47 $helper->{setup_connect_info} = 1;
49 $_ = qq{'$_'} if $_ !~ /^\s*[[{]/;
51 $helper->{connect_info} = \@connect_info;
54 my $file = $helper->{file};
55 $helper->render_file( 'compclass', $file );
60 General Catalyst Stuff:
62 L<Catalyst::Manual>, L<Catalyst::Test>, L<Catalyst::Request>,
63 L<Catalyst::Response>, L<Catalyst::Helper>, L<Catalyst>,
65 Stuff related to DBIC and this Model style:
67 L<DBIx::Class>, L<DBIx::Class::Schema>,
68 L<DBIx::Class::Schema::Loader>, L<Catalyst::Model::DBIC::Schema>,
69 L<Catalyst::Helper::Model::DBIC::SchemaLoader>
73 Brandon L Black, C<blblack@gmail.com>
77 This library is free software, you can redistribute it and/or modify
78 it under the same terms as Perl itself.
92 use base 'Catalyst::Model::DBIC::Schema';
95 schema_class => '[% schema_class %]',
96 [% IF setup_connect_info %]connect_info => [
97 [% FOREACH arg = connect_info %][% arg %],
104 [% class %] - Catalyst DBIC Schema Model
112 L<Catalyst::Model::DBIC::Schema> Model using schema
113 L<[% schema_class %]>
121 This library is free software, you can redistribute it and/or modify
122 it under the same terms as Perl itself.