NAME
DBIx::QueryByName::QueryPool - Manages a pool of sql query descriptions
DESCRIPTION
An instance of DBIx::QueryByName::QueryPool stores the descriptions of all the queries that can be executed with corresponding instances of DBIx::QueryByName.
DO NOT USE DIRECTLY!
INTERFACE
This API is subject to change!
my $pool = DBIx::QueryByName::QueryPool->new();
-
Instanciate DBIx::QueryByName::QueryPool.
$pool->add_query(name => $name, sql => $sql, session => $session, params => \@params);
-
Add a query to this pool. Example:
$pool->add_query(name => 'get_user_adress', sql => 'SELECT adress FROM adresses WHERE firstname=? AND lastname=?', params => [ 'firstname', 'lastname' ], session => 'name_of_db_connection', );
$pool->knows_query($name);
-
True if the pool already contains a query with that name. False otherwise.
my ($session,$sql,@params) = $pool->get_query($name);
-
Return the name of the database session, the sql code and the named parameters of the query named
$name
. Croak if no query with that name.