NAME

Egg::Model::DBI - DBI for Egg Model.

SYNOPSIS

  __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;

DESCRIPTION

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.

METHODS

connect

The connection with the data base is established.

see DBI or Ima::DBI.

dbh

The data base handler is returned.

* If connect is not done, connect is done still.

disconnect

The connection with the data base is cut.

DESTROY

When the object disappears, disconnect is called.

SEE ALSO

DBI, Ima::DBI, Egg::Model, Egg::Release,

AUTHOR

Masatoshi Mizuno <lushe@cpan.org>

COPYRIGHT

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.