NAME
App::Dochazka::REST::ConnBank - Provide DBIx::Connector objects
VERSION
Version 0.466
SYNOPSIS
use App::Dochazka::REST::ConnBank qw( $dbix_conn conn_status );
$dbix_conn->run( fixup => sub {
...
} );
print "Database connection status: " . conn_status() . "\n";
# construct an arbitrary DBIx::Connector object
my $conn = App::Dochazka::REST::ConnBank::get_arbitrary_dbix_conn(
'mydb', 'myuser', 'mypass'
);
DESCRIPTION
This module contains routines relating to DBIx::Connector. Mostly, the application uses the $dbix_conn
singleton.
EXPORTS
PACKAGE VARIABLES
This module stores the DBIx::Connector singleton object that is imported by all modules that need to communicate with the database.
FUNCTIONS
get_arbitrary_dbix_conn
Wrapper for DBIx::Connector->new. Takes database name, database user and password. Returns a DBIx::Connector object.
init_singleton
Initialize the $dbix_conn
singleton. Takes dbname, dbuser, dbpass.
conn_status
Given a DBIx::Connector object, call ping on the associated database handle and return either 'UP' or 'DOWN' based on the result.
If no argument is given, returns the status of the $dbix_conn
singleton.