NAME

Egg::Helper::Model::DBIC - Helper for Egg::Model::DBIC.

SYNOPSIS

% cd /path/to/MyApp/bin
% ./myapp_helper.pl M::DBIC MySchema -d dbi:SQLite:dbname=dbfile
..........
......

DESCRIPTION

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

CONFIGURATION

The configuration can be set as a controller who generates it.

package MyApp::Model::DBIC::MySchema;
use base ........
.....

__PACKAGE__->config(
  .......
  );

label_name

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.

label_source

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

DSN

user

User of data base.

password

Password of data base.

options

Option to pass to DBI.

SEE ALSO

Egg::Release, Egg::Model::DBIC, DBIx::Class::Schema::Loader, UNIVERSAL::require,

AUTHOR

Masatoshi Mizuno <lushe@cpan.org>

COPYRIGHT AND LICENSE

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.