Optional. Supply a array ref of session_id or alias and an event. Any connect errors will be posted to this session and event with the query that failed as ARG0 or an empty hash ref if no query was in the queue. The query will be retried, so DON'T resend the query. If this parameter is not supplied, the normal behavour will be to drop the subprocess and restart max_retries times.

Optional. Supply a array ref of session_id or alias and an event. When the component makes a successful connection this event will be called with the next query as ARG0 or an empty hash ref if no queries are in the queue. DON'T resend the query, it will be processed.

Optional. If 1, an alternate type of fork will be used for the database process. This usually results in lower memory use of the child. You can also specify alt_fork => '/path/to/perl' if you are using POE inside of another app like irssi. *Experimental, and WILL NOT work on Windows Platforms*

This sends off a string to be quoted, and gets it back.
Internally, it does this:
return $dbh->quote( $SQL );
Here's an example on how to trigger this event:
$kernel->post( 'EasyDBI',
quote => {
sql => 'foo$*@%%sdkf"""',
event => 'quoted_handler',
}
);
The Success Event handler will get a hash ref in ARG0:
{
sql => Unquoted SQL sent
result => Quoted SQL
}

This query is for those queries where you will get exactly one row and
column back.
Internally, it does this:
$sth = $dbh->prepare_cached( $sql );
$sth->bind_columns( %result );
$sth->execute( $placeholders );
$sth->fetch();
return %result;
Here's an example on how to trigger this event:
$kernel->post( 'EasyDBI',
single => {
sql => 'Select test_id from FooTable',
event => 'result_handler',
}
);
The Success Event handler will get a hash in ARG0:
{
sql => SQL sent
result => scalar
placeholders => Original placeholders
}

This is for calling $dbh->func(), when using a driver that supports it.
Internally, it does this:
return $dbh->func(@{$args});
Here's an example on how to trigger this event (Using DBD::AnyData):
$kernel->post( 'EasyDBI',
func => {
args => ['test2','CSV',["id,phrase\n1,foo\n2,bar"],'ad_import'],
event => 'result_handler',
}
);
The Success Event handler will get a hash in ARG0:
{
sql => SQL sent
result => return value
}

This is for calling $dbh->commit(), if the driver supports it.
Internally, it does this:
return $dbh->commit();
Here's an example on how to trigger this event:
$kernel->post( 'EasyDBI',
commit => {
event => 'result_handler',
}
);
The Success Event handler will get a hash in ARG0:
{
sql => SQL sent
result => return value
}

This is for calling $dbh->rollback(), if the driver supports it.
Internally, it does this:
return $dbh->rollback();
Here's an example on how to trigger this event:
$kernel->post( 'EasyDBI',
rollback => {
event => 'result_handler',
}
);
The Success Event handler will get a hash in ARG0:
{
sql => SQL sent
result => return value
}

This is for calling $dbh->begin_work(), if the driver supports it.
Internally, it does this:
return $dbh->begin_work();
Here's an example on how to trigger this event:
$kernel->post( 'EasyDBI',
begin_work => {
event => 'result_handler',
}
);
The Success Event handler will get a hash in ARG0:
{
sql => SQL sent
result => return value
}

$kernel->post( 'EasyDBI', 'shutdown' );
This will signal EasyDBI to start the shutdown procedure.
NOTE: This will let all outstanding queries run!
EasyDBI will kill it's session when all the queries have been processed.
you can also specify an argument:
$kernel->post( 'EasyDBI', 'shutdown' => 'NOW' );
This will signal EasyDBI to shutdown.
NOTE: This will NOT let the outstanding queries finish!
Any queries running will be lost!
Due to the way POE's queue works, this shutdown event will take some time
to propagate POE's queue. If you REALLY want to shut down immediately, do
this:
$kernel->call( 'EasyDBI', 'shutdown' => 'NOW' );
ALL shutdown NOW's send kill 9 to thier children, beware of any
transactions that you may be in. Your queries will revert if you are in
transaction mode

You can pass the parameter 'chunked' with a number of rows to fire the 'event' event for every 'chunked' rows, it will fire the 'event' event. (a 'chunked' key will exist) A 'last_chunk' key will exist when you have received the last chunk of data from the query