Egg::Helper::Model::DBIC - Helper for Egg::Model::DBIC.
% cd /path/to/MyApp/bin % ./myapp_helper.pl M::DBIC MySchema -d dbi:SQLite:dbname=dbfile .......... ......
It is a helper who generates the control module of Egg::Model::DBIC under the control of the project.
It starts specifying the 'Model::DBIC' mode and the generated module name for the helper script of the project to use it.
% ./myapp_helper.pl Model::DBIC [SCHEMA_NAME]
The setting of DBI can be buried in passing the following options to the helper script.
-d ... DNS. -s ... Host of data base. -i ... The Internet port of data base. -u ... User of data base. -p ... Password of data base. -v ... Version of generated component.
When all the options are specified, it becomes the following feeling.
% ./myapp_helper.pl Model::DBIC MySchema \ % -d dbi:Pg:dbname=dbfile \ % -s localhost \ % -i 5432 \ % -u db_user \ % -p db_password \ % -v 0.01
The configuration can be set as a controller who generates it.
package MyApp::Model::DBIC::MySchema; use base ........ ..... __PACKAGE__->config( ....... );
Label name when accessing it by 'model' method of project.
It is 'dbic::myschema' revokable.
__PACKAGE__->config( label_name => 'hoge', ); my $schema= $e->model('hoge');
Please note that there are neither a label name of other models nor a collision when setting it.
The label to access the source that belongs to Schema can be set with HASH.
It is 'dbic::myschema::moniker' revokable.
__PACKAGE__->config( label_source => { hogehoge => 'MyMoniker', ..... }, ); my $hoge= $e->model('hogehoge');
DSN
User of data base.
Password of data base.
Option to pass to DBI.
Egg::Release, Egg::Model::DBIC, DBIx::Class::Schema::Loader, UNIVERSAL::require,
Masatoshi Mizuno <lushe@cpan.org>
Copyright (C) 2008 Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.
To install Egg::Release::DBIC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Egg::Release::DBIC
CPAN shell
perl -MCPAN -e shell install Egg::Release::DBIC
For more information on module installation, please visit the detailed CPAN module installation guide.