NAME

DBIx::Async::Handle - statement handle for DBIx::Async

VERSION

version 0.003

DESCRIPTION

Some DBIx::Async methods ("prepare" in DBIx::Async for example) return statement handles. Those statement handles are supposed to behave something like DBI's statement handles. Where they don't, this is either a limitation of the async interface or a bug. Please report if the latter.

METHODS

new

Returns $self.

dbh

Returns the database handle which created this statement handle.

execute

Executes this statement handle, takes an optional list of bind parameters.

Returns a Future which will resolve when the statement completes.

finish

Marks this statement handle as finished.

Returns a Future which will resolve when the statement is finished.

fetchrow_hashref

Fetch a single row, returning the results as a hashref.

Since the data won't necessarily be ready immediately, this returns a Future which will resolve with the requested hashref.

iterate

A helper method for iterating over results.

Takes two parameters:

  • $method - the method to call, for example "fetchrow_hashref"

  • $code - the code to run for each result

$sth->iterate(
 fetchrow_hashref => sub {
  
 }
)

Returns $self.

TODO

  • There are many other ->fetch* variants. Add them.

AUTHOR

Tom Molesworth <cpan@perlsite.co.uk>

LICENSE

Copyright Tom Molesworth 2012-2015. Licensed under the same terms as Perl itself.