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 [ dsn user password ]
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 dsn, user, and password are optional if connection info is already
20 defined in your Schema class (as it would be in the case of
21 DBIx::Class::Schema::Loader).
25 Helper for the DBIC Schema Models.
34 my ( $self, $helper, $schema_class, $dsn, $user, $pass ) = @_;
36 $helper->{schema_class} = $schema_class || '';
39 $helper->{setup_connect_info} = 1;
40 $helper->{dsn} = $dsn || '';
41 $helper->{user} = $user || '';
42 $helper->{pass} = $pass || '';
45 my $file = $helper->{file};
46 $helper->render_file( 'compclass', $file );
51 General Catalyst Stuff:
53 L<Catalyst::Manual>, L<Catalyst::Test>, L<Catalyst::Request>,
54 L<Catalyst::Response>, L<Catalyst::Helper>, L<Catalyst>,
56 Stuff related to DBIC and this Model style:
58 L<DBIx::Class>, L<DBIx::Class::Schema>,
59 L<DBIx::Class::Schema::Loader>, L<Catalyst::Model::DBIC::Schema>,
60 L<Catalyst::Helper::Model::DBIC::SchemaLoader>
64 Brandon L Black, C<blblack@gmail.com>
68 This library is free software, you can redistribute it and/or modify
69 it under the same terms as Perl itself.
83 use base 'Catalyst::Model::DBIC::Schema';
86 schema_class => '[% schema_class %]',
87 [% IF setup_connect_info %]
88 connect_info => [ '[% dsn %]',
94 ShowErrorStatement => 1,
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.