Morris::Plugin::DBI - Register Database Instances To Be Used In Plugins
<Connection whatever> <Plugin DBI> <Instance db01> dsn dbi:SQLite:dbname=foo.db </Instance> <Instance db02> dsn dbi:mysql:dbname=bar username foo </Instance> </Plugin> <Plugin Some::Other::Plugin> dbname db01 </Plugin> <Plugin Yet::Another::Plugin> dbname db02 </Plugin> </Connection>
This plugin creates a database store for plugins to use.
The associated Morris::Connection object will have a new method name get_dbh($name) that will allow you to get a handle to AnyEvent::DBI object of that name.
get_dbh($name)
Plugins may optionally consume the Morris::Plugin::WithDB role to implant a utility method get_dbh() (on the plugin, not the connection), which will fetch the database specified in the dbname configuration parameter.
get_dbh()
dbname
Morris::Plugin::WithDB
To install Morris, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Morris
CPAN shell
perl -MCPAN -e shell install Morris
For more information on module installation, please visit the detailed CPAN module installation guide.