RFC: new module SQL::QueryQueue

M

mapeck65

Looking for comments on the name, as well as the function of this
module proposal. This will be my first public module submission, of a
module I have developed and used privately for a few months. The
intention of the module is to provide a FIFO queue for execution of
SQL statements, providing a fault-tolerant, abstraction of the DBI.
During times of lost database connectivity, statements will be queued
while the SQL::QueryQueue object tries to reconnect. Once a
connection has been reestablished, the queue will resume processing.

SYNOPSIS:

use SQL::QueryQueue;
....
my $queue = SQL::QueryQueue->instance($db_dsn, $db_user_id,
$db_password);
my $sql = qq { update test set ip = '209.197.123.153' where domain
= ?};
$queue->submit_job($sql, 'perlmonks.org');
....
# in another sub somewhere in your program...
my $q = SQL::QueryQueue->instance();
my $sql = qq{ select * from test where ip like '209.%' };
my $array_ref = $q->submit_job($sql);
foreach my $row (@$array_ref) {
print join ', ', @$row, "\n";

}

The SQL::QueryQueue object inherits from Class::Singleton and depends
on DBI. The current implementation also depends on Log::Log4perl and
Linuga::EN::Numbers::Ordinate, though these dependencies could be
removed.

Any comments & suggestions are greatly appreciated.

Michael Peck
mpeck [at] pobox.com
 
S

smallpond

Looking for comments on the name, as well as the function of this
module proposal. This will be my first public module submission, of a
module I have developed and used privately for a few months. The
intention of the module is to provide a FIFO queue for execution of
SQL statements, providing a fault-tolerant, abstraction of the DBI.
During times of lost database connectivity, statements will be queued
while the SQL::QueryQueue object tries to reconnect. Once a
connection has been reestablished, the queue will resume processing.

SYNOPSIS:

use SQL::QueryQueue;
...
my $queue = SQL::QueryQueue->instance($db_dsn, $db_user_id,
$db_password);
my $sql = qq { update test set ip = '209.197.123.153' where domain
= ?};
$queue->submit_job($sql, 'perlmonks.org');
...
# in another sub somewhere in your program...
my $q = SQL::QueryQueue->instance();
my $sql = qq{ select * from test where ip like '209.%' };
my $array_ref = $q->submit_job($sql);
foreach my $row (@$array_ref) {
print join ', ', @$row, "\n";

}

The SQL::QueryQueue object inherits from Class::Singleton and depends
on DBI. The current implementation also depends on Log::Log4perl and
Linuga::EN::Numbers::Ordinate, though these dependencies could be
removed.

Any comments & suggestions are greatly appreciated.

Michael Peck
mpeck [at] pobox.com


Looks like a good idea, but why the limitation to a single instance?
I've known of applications using multiple connected databases.
--S
 
D

Dr.Ruud

(e-mail address removed) schreef:
Looking for comments on the name, as well as the function of this
module proposal.

See also:
Mailing-List: contact modules-help(AT)perl.org; run by ezmlm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top