DBIx::...:Union(3pm)
π DBIx::SearchBuilder::Union β the manual page, but make it a group chat
okay bestie, gather round, because this is DBIx::SearchBuilder::Union from the User Contributed Perl Documentation corner of the universe, and it is exactly what it sounds like: it lets you take a whole bunch of SearchBuilder result sets and treat them like one single collection. it's giving "two searches, one list" energy and honestly? iconic. π
β¨ NAME β¨
DBIx::SearchBuilder::Union β Deal with multiple SearchBuilder result sets as one π«Ά
π¦ SYNOPSIS π¦
like, look how cute this is:
use DBIx::SearchBuilder::Union;
my $U = new DBIx::SearchBuilder::Union;
$U->add( $tickets1 );
$U->add( $tickets2 );
$U->GotoFirstItem;
while (my $z = $U->Next) {
printf "%5d %30.30s\n", $z->Id, $z->Subject;
}
yes bestie, that's the whole vibe. add your collections, GotoFirstItem, then just Next your way into the sunset. π
β οΈ WARNING β οΈ
This module is still experimental. π
not me being the responsible one for once β fr fr, tread lightly, it's still cooking.
πΈ DESCRIPTION πΈ
so here's the tea: this module implements a subset of the DBIx::SearchBuilder collection methods. not all of them β just enough to do iteration over a bunch of results. β¨
and why would you want that? because it's useful for displaying the results of two unrelated searches (for the same kind of objects) in a single list. that's it, that's the whole point, and it ate. π
π METHODS π
new
Create a new DBIx::SearchBuilder::Union object. No arguments. that's it. no parameters, no drama, no situationship. just vibes. π
add $sb
Add a searchbuilder result (collection) to the Union object. π«
It must be the same type as the first object added.
like, the first one sets the standard and everyone else has to match. main character energy, honestly. π
First
Return the very first element of the Union (which is the first element of the first Collection). Also reset the current pointer to that element. π
two jobs, zero complaints.
Next
Return the next element in the Union. β‘οΈ
the one you'll be calling in a while loop forever, iykyk.
Last
Returns the last item πβ¨
Count
Returns the total number of elements in the Union'ed Collection π’
yes she counts everything, across all the collections. no element left behind.
GotoFirstItem
Starts the recordset counter over from the first item. the next time you call Next, you'll get the first item returned by the database, as if you'd just started iterating through the result set. π
it's a rewind button, bestie. just press it.
IsLast
Returns true if the current row is the last record in the set. β
the "am I at the end?" check, so you don't have to guess.
ItemsArrayRef
Return a reference to an array containing all objects found by this search. π¦
Will destroy any positional state. π
okay so real talk: if you had a cursor position going, it is gone. it's a full reset. don't call this mid-iteration unless you're cool with starting over. periodt.
and that's the whole page, bestie. no cap, every method, every caveat, every warning β all accounted for. π
this little masterpiece is documented as DBIx::...:Union(3pm), perl v5.40.1, dated 2026-05-07. slay, go union your searches. byeee π¦πβ¨
π¦ where this page comes from
- ubuntu stonking: libdbix-searchbuilder-perl 1.85-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