KiokuD...::Query(3pm)

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

πŸ’– KiokuDB::Backend::Role::Query β€” bestie edition πŸ’–

okay so this is a Perl manual page, the <pink>3pm</pink> kind, and it's filed under User Contributed Perl Documentation. Sit down, hydrate, we're learning about backend queries 🫢


✨ NAME ✨

KiokuDB::Backend::Role::Query β€” the Backend specific query API πŸ’…


🌸 VERSION 🌸

version 0.57 β€” yes she's on 0.57, periodt ✨


πŸŽ€ SYNOPSIS πŸŽ€

Like, here's the whole vibe in code, no cap:

with qw(KiokuDB::Backend::Role::Query);

sub search {
    my ( $self, @args ) = @_;

    # return all entries in the root set matching @args (backend specific)
    return Data::Stream::Bulk::Foo->new(...);
}

That comment is literally part of the code bestie, I'm not adding anything, that's just what it says. The search sub gets $self and a pile of @args, and it hands back all the entries in the root set that match those @args β€” and the matching itself is, you guessed it, backend specific. Then it returns a Data::Stream::Bulk::Foo->new(...) πŸ¦‹


🌈 DESCRIPTION 🌈

So this role exists for backend specific searching. That's the whole job description, she's a specialist πŸ’

The way to tell whether something counts as "backend specific" is honestly so simple: anything that is NOT KiokuDB::Backend::Role::Query::Simple is a backend specific search. That's it. That's the rule. Could be a Search::GIN::Query, could be something else entirely, doesn't matter β€” if it's not that one module, it's backend specific, fr fr.

And here's what the backend is expected to do (expectations, we love to see them πŸ‘‘): it takes the search arguments that get passed through from "search" in KiokuDB β€” passed as is, no touching, no editing, no glow-up β€” and it interprets them. Then it returns a Data::Stream::Bulk of the matching entries. So you get a stream, you get bulk, you get your matches. Slay ✨

no cap: the backend does the interpreting here. That's literally its job. Don't come for the args, they arrive exactly as they were sent.

πŸ’œ AUTHOR πŸ’œ

Yuval Kogman <nothingmuch@woobling.org> β€” iconic, we stan 🫢


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. So like, go forth, remix, redistribute, it's giving generous πŸ’–


aaaand that's the page bestie πŸŽ€ this was perl v5.34.0, dated 2022-05-23, and that footer was the last line of the whole thing β€” so consider this your cute lil sign-off. mwah πŸ’…βœ¨

πŸ“¦ where this page comes from