Catalyst::Model::DBI - DBI Model Class
# use the helper create model DBI DBI dsn user password # lib/MyApp/Model/DBI.pm package MyApp::Model::DBI; use base 'Catalyst::Model::DBI'; __PACKAGE__->config( dsn => 'dbi:Pg:dbname=myapp', password => '', user => 'postgres', options => { AutoCommit => 1 }, ); 1; my $dbh = $c->model('DBI')->dbh; #do something with $dbh ...
This is the DBI model class.
DBI
Initializes DBI connection
Returns the current database handle.
Returns a connected database handle.
Returns true if the database handle is active and pingable.
Connects to the database and returns the handle.
Executes rollback if AutoCommit is active, disconnects and unsets the database handle.
Catalyst, DBI
Alex Pavlovic, alex.pavlovic@taskforce-1.com
alex.pavlovic@taskforce-1.com
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
To install Catalyst::Model::DBI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Model::DBI
CPAN shell
perl -MCPAN -e shell install Catalyst::Model::DBI
For more information on module installation, please visit the detailed CPAN module installation guide.