KiokuD...::Scan(3pm)

πŸ“¦
version 0.57 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing

πŸ’– 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 a Data::Stream::Bulk stream 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 a Data::Stream::Bulk of just the root entries. only the mains, only the headliners, no side characters. 🌟
  • child_entries β€” should return a Data::Stream::Bulk of 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. 🫑


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