73 lines
1.9 KiB
HTML
73 lines
1.9 KiB
HTML
<?xml version="1.0" ?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title>Peace::DB - Database handler generator for the Peace shop.</title>
|
|
<meta content="text/html; charset=utf-8" http-equiv="content-type" />
|
|
<link href="mailto:Alpine@build-edge-aarch64.nonet" rev="made" />
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<ul id="index">
|
|
<li><a href="#NAME">NAME</a></li>
|
|
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
|
|
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
|
|
<li><a href="#FUNCTIONS">FUNCTIONS</a>
|
|
<ul>
|
|
<li><a href="#dbh">dbh</a></li>
|
|
<li><a href="#run_migrations">run_migrations</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#SEE-ALSO">SEE ALSO</a></li>
|
|
</ul>
|
|
|
|
<h1 id="NAME">NAME</h1>
|
|
|
|
<p>Peace::DB - Database handler generator for the Peace shop.</p>
|
|
|
|
<h1 id="SYNOPSIS">SYNOPSIS</h1>
|
|
|
|
<pre><code>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 );</code></pre>
|
|
|
|
<h1 id="DESCRIPTION">DESCRIPTION</h1>
|
|
|
|
<p>This module helps to recover a database handle and runs the migrations automatically when doing so.</p>
|
|
|
|
<h1 id="FUNCTIONS">FUNCTIONS</h1>
|
|
|
|
<p>Peace::DB implements the following functions:</p>
|
|
|
|
<h2 id="dbh">dbh</h2>
|
|
|
|
<p>Recovers a database handle, requires the config of the app as its parameter.</p>
|
|
|
|
<pre><code>my $dbh = Peace::DB->dbh( config => $config );</code></pre>
|
|
|
|
<h2 id="run_migrations">run_migrations</h2>
|
|
|
|
<p>Runs the migrations manually.</p>
|
|
|
|
<pre><code>Peace::DB->run_migrations($dbh);</code></pre>
|
|
|
|
<h1 id="SEE-ALSO">SEE ALSO</h1>
|
|
|
|
<p><a href="https://metacpan.org/pod/DBI">DBI</a>, <a href="https://metacpan.org/pod/DBD::Pg">DBD::Pg</a>, <a href="../Peace.pm.html">Peace</a></p>
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|