Sweet::Schema
In lib/My/Project.pm.
lib/My/Project.pm
package My::Project; use Moose; with 'Sweet::Schema'; __PACKAGE__->meta->make_immutable;
Generate lib/My/Project/Schema.pm and its Result subclasses with
lib/My/Project/Schema.pm
Result
$ dbicdump -o dump_directory=./lib My::Project::Schema dbi:Oracle:XE scott tiger Dumping manual schema for My::Project::Schema to directory ./lib ... Schema dump completed.
In lib/My/Project/DatabaseConnection.pm
lib/My/Project/DatabaseConnection.pm
package My::Project::DatabaseConnection; use Moose; with 'My::Project::Config'; __PACKAGE__->meta->make_immutable;
In lib/My/Project/Config.pm
lib/My/Project/Config.pm
package My::Project::DatabaseConnection; use Moose; extends 'Sweet::DatabaseConnection'; with 'My::Project::Config'; __PACKAGE__->meta->make_immutable;
In $HOME/.myproject.yml
$HOME/.myproject.yml
My: Project: DatabaseConnection: datasource: dbi:Oracle:XE username: scott password: tiger
Defaults to __PACKAGE__::DatabaseConnection.
__PACKAGE__::DatabaseConnection
Defaults to __PACKAGE__::Schema.
__PACKAGE__::Schema
To install Sweet::Home, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sweet::Home
CPAN shell
perl -MCPAN -e shell install Sweet::Home
For more information on module installation, please visit the detailed CPAN module installation guide.