The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

DBIx::Poggy::DBI - DBI subclass

DESCRIPTION

Overrides several methods in DBI. All queries are marked as async. See list of supported methods below:

METHODS

supported

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".

not supported

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.

Transactions

This module wraps "begin_work", "commit" and "rollback" methods to help handle transactions.

NOTE that behaviour is not yet defined when commiting or rolling back a transaction with active query. I just havn't decided what to do in this case. Now it's your job to make sure commit/rollback happens after all queries on the handle.

begin_work

Returns a Promise that will be resolved once transaction is committed or rejected on rollback or failed attempt to start the transaction.

commit

Takes resolution value of the transaction, commits and resolves the promise returned by "begin_work".

rollback

Takes rollback value of the transaction, commits and rejects the promise returned by "begin_work".