1Data::Stream::Bulk::DBIU(s3e)r Contributed Perl DocumentaDtaitoan::Stream::Bulk::DBI(3)
2
3
4

NAME

6       Data::Stream::Bulk::DBI - N-at-a-time iteration of DBI statement
7       results.
8

SYNOPSIS

10           use Data::Stream::Bulk::DBI;
11
12           my $sth = $dbh->prepare("SELECT hate FROM sql"); # very big resultset
13           $sth->execute;
14
15           return Data::Stream::Bulk::DBI->new(
16               sth => $sth,
17               max_rows => $n, # how many at a time
18               slice => [ ... ], # if you want to pass the first param to fetchall_arrayref
19           );
20

DESCRIPTION

22       This implementation of Data::Stream::Bulk api works with DBI statement
23       handles, using "fetchall_arrayref" in DBI.
24
25       It fetches "max_rows" at a time (defaults to 500).
26

ATTRIBUTES

28   sth
29       The statement handle to call "fetchall_arrayref" on.
30
31   slice
32       Passed verbatim as the first param to "fetchall_arrayref". Should
33       usually be "undef", provided for completetness.
34
35   max_rows
36       The second param to "fetchall_arrayref". Controls the size of each
37       buffer.
38
39       Defaults to 500.
40

METHODS

42   get_more
43       See Data::Stream::Bulk::DoneFlag.
44
45       Calls "fetchall_arrayref" to get the next chunk of rows.
46
47   all
48       Calls "fetchall_arrayref" to get the raminder of the data (without
49       specifying "max_rows").
50

AUTHOR

52       Yuval Kogman <nothingmuch@woobling.org>
53
55       This software is copyright (c) 2010 by Yuval Kogman.
56
57       This is free software; you can redistribute it and/or modify it under
58       the same terms as the Perl 5 programming language system itself.
59
60
61
62perl v5.12.1                      2010-08-24        Data::Stream::Bulk::DBI(3)
Impressum