NAME

Peace::DB - Database handler generator for the Peace shop.

SYNOPSIS

my $peace = Peace->new;
my $home  = $ENV{HOME};
my $config =
  $peace->plugin(
    JSONConfig => {
      file => "$home/.config/peace/peace.conf"
    }
  );
my $dbh = Peace::DB->dbh( config => $config );

DESCRIPTION

This module helps to recover a database handle and runs the migrations automatically when doing so.

FUNCTIONS

Peace::DB implements the following functions:

dbh

Recovers a database handle, requires the config of the app as its parameter.

my $dbh = Peace::DB->dbh( config => $config );

run_migrations

Runs the migrations manually.

Peace::DB->run_migrations($dbh);

SEE ALSO

DBI, DBD::Pg, Peace