Data::...lk::DBI(3pm)
β¨ Data::Stream::Bulk::DBI π
okay so bestie, welcome to Data::...lk::DBI β yes that's the name, the manpage header literally abbreviates it like that, we don't ask questions, we just vibe. It's a Perl module (a 3pm page, if you're keeping score), and it's about pulling rows out of a database a little at a time instead of dragging the whole giant resultset into RAM and crying about it. π«Ά
πΈ VERSION πΈ
version 0.11
π SYNOPSIS π
use Data::Stream::Bulk::DBI;
my $sth = $dbh->prepare("SELECT hate FROM sql"); # very big resultset
$sth->execute;
return Data::Stream::Bulk::DBI->new(
sth => $sth,
max_rows => $n, # how many at a time
slice => [ ... ], # if you want to pass the first param to fetchall_arrayref
);
like. look at it. "SELECT hate FROM sql". whoever wrote that was going through something and honestly? relatable. π
π DESCRIPTION π
So this is one of the implementations of the Data::Stream::Bulk api (yes, "api" lowercase, that's how they wrote it, I'm not touching it), and it works specifically with DBI statement handles. Under the hood it's leaning on "fetchall_arrayref" in DBI.
The whole point: it fetches "max_rows" rows at a time. That defaults to 500. So instead of one terrifying mega-fetch, you get a cute lil steady drip of chunks. N-at-a-time iteration energy. β¨
π ATTRIBUTES π
sthβ the statement handle that we're gonna call"fetchall_arrayref"on. that's it. that's the whole job. πsliceβ this gets passed verbatim as the first param to"fetchall_arrayref". bestie, it should usually just be"undef"β it's provided for completetness. (that's their spelling, and I love them for it, keeping it. π)max_rowsβ the second param to"fetchall_arrayref". this is the one that controls how big each buffer is. it defaults to500. π
π¦ METHODS π¦
get_moreβ seeData::Stream::Bulk::DoneFlagfor the whole picture. what it does: it calls"fetchall_arrayref"to grab the next chunk of rows. that's the move. π₯allβ calls"fetchall_arrayref"to get the raminder of the data β and yes, "raminder", that's the typo, I am not fixing it, it's part of the family now β and importantly it does this without specifying"max_rows". so it's the "gimme everything left" button. π
π AUTHOR π
Yuval Kogman <nothingmuch@woobling.org>
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2012 by Yuval Kogman.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
okay that's the whole page, you ate that, go forth and stream your rows in chunks like the main character you are π β¨
signing off from perl v5.32.0, dated 2021-01-01, on the page Data::...lk::DBI(3pm) β mwah, bye bestie ππ¦π
π¦ where this page comes from
- debian bookworm: libdata-stream-bulk-perl 0.11-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libdata-stream-bulk-perl 0.11-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libdata-stream-bulk-perl 0.11-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libdata-stream-bulk-perl 0.11-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms