KiokuD...::Scan(3pm)
π KiokuDB::Backend::Role::Scan π
okay bestie, welcome to the Perl 5 manpage corner of the internet β this one's a User Contributed Perl Documentation page, and it's literally all about scanning your backend's root set. let's get into it π¦
β¨ VERSION β¨
version 0.57</purl> β yes, that's the whole vibe. no cap.
πΈ SYNOPSIS πΈ
okay so picture this, you're building a backend and you want the scan role in your life:
with qw(KiokuDB::Backend::Role::Scan);
sub all_entries {
my $self = shift;
# return all root set entries
return Data::Stream::Bulk::Foo->new(...);
}
that's it, that's the whole flex. Data::Stream::Bulk::Foo is a placeholder btw, you'd swap in your actual stream class. iykyk π
π DESCRIPTION π
so this is a role for iterative scanning of all entries in a backend. it's giving "walk the whole database, one entry at a time, no stress". πΆβοΈβ¨
what's it for? database backups, and various other tasks. iconic use case honestly. if you need to enumerate every single thing in your backend, this role is your girl.
π REQUIRED METHODS π
okay you have to implement this one, no skipping, periodt:
all_entriesβ should return aData::Stream::Bulkstream enumerating all entries in the database. that's the whole assignment bestie, hand in a stream and you're done. π«Ά
π OPTIONAL METHODS π
these method have default implementations defined in terms of "all_entries" β so like, you can just let them do their thing. but (and this is the juicy part) they maybe be overridden if there is a more optimal solution than just filtering that stream. i.e. if filtering feels lowkey wasteful, go off and write something smarter. π₯
root_entriesβ should return aData::Stream::Bulkof just the root entries. only the mains, only the headliners, no side characters. πchild_entriesβ should return aData::Stream::Bulkof everything but the root entries. so like, the inverse vibe of the one above. π
π AUTHOR π
Yuval Kogman <nothingmuch@woobling.org> β thank you for your service king, we love you. π«‘
β COPYRIGHT AND LICENSE β
This software is copyright (c) 2014 by Yuval Kogman, Infinity Interactive.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, open source behavior fr fr. π
okay that's the whole page bestie, and before i go β quick sign-off from the footer: this doc lives in perl v5.34.0 land and was dated 2022-05-23, so it's a lil vintage but still ate. πβ¨ go forth and scan your entries. π¦
π¦ where this page comes from
- debian bookworm: libkiokudb-perl 0.57-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libkiokudb-perl 0.57-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libkiokudb-perl 0.57-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu questing: libkiokudb-perl 0.57-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms