Egg::Model::DBI - DBI for Egg Model.
__PACKAGE__->egg_startup( MODEL => [ [ DBI => { dsn => 'dbi:Pg:dbname=hogedb;host=localhost;port=5432', user => 'myapp_user', password => 'myapp_password', options => { AutoCommit=> 1, RaiseError=> 1 }, } ], ], ); # The DBI model is acquired. my $model = $e->model('DBI'); # dbh is acquired. my $dbh= $model->dbh; # The data base is disconnect. $model->disconnect;
MODEL for Egg to use DBI.
If Ima::DBI can be used, Ima::DBI is used.
* Ima::DBI supports the perpetuity connection with the data base because it has the data base connection with Closure. It comes do not to have to set Apache::DBI separately for the perpetuity connection.
The connection with the data base is established.
see DBI or Ima::DBI.
The data base handler is returned.
* If connect is not done, connect is done still.
The connection with the data base is cut.
When the object disappears, disconnect is called.
DBI, Ima::DBI, Egg::Model, Egg::Release,
Masatoshi Mizuno <lushe@cpan.org>
Copyright (C) 2007 by 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, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Egg::Release
CPAN shell
perl -MCPAN -e shell install Egg::Release
For more information on module installation, please visit the detailed CPAN module installation guide.