DBIx::Poggy::DBI - DBI subclass
Overrides several methods in DBI. All queries are marked as async. See list of supported methods below:
These are supported: "selectrow_array" in DBI, "selectrow_arrayref" in DBI, "selectrow_hashref" in DBI, "selectall_arrayref" in DBI, "selectall_hashref" in DBI and "do" in DBI.
For example:
$pool->take->selectrow_array( "SELECT * FROM test LIMIT 1", )->then(sub { my @row = @_; ... });
See "Transactions" to learn about "begin_work", "commit" and "rollback".
These are not supported, but will be when I need them or somebody will write a patch: "selectcol_arrayref" in DBI
You don't use prepare, bind*, execute or fetch*. I have some ideas of making these work, but don't think there is urgent need to pursue.
prepare
bind*
execute
fetch*
This module wraps "begin_work", "commit" and "rollback" methods to help handle transactions.
NOTE that flow is similar to sync DBI: begin, query, query, ..., commit or rollback, so it's your job to make sure commit or rollback is called after all queries on the handle are finished otherwise code dies.
Returns a Promise that will be resolved once transaction is committed or rejected if the transaction is rolled back or failed attempt to start the transaction.
Value of the promise would be whatever is passed to commit or rollback.
Takes resolution value of the transaction, commits and resolves the promise returned by "begin_work" with the value.
Dies if you call commit without transaction or while queries are active.
Takes rollback value of the transaction, commits and rejects the promise returned by "begin_work" with the value.
Dies if you call rollback without transaction or while queries are active.
To install DBIx::Poggy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Poggy
CPAN shell
perl -MCPAN -e shell install DBIx::Poggy
For more information on module installation, please visit the detailed CPAN module installation guide.