Jifty:...Unique(3pm)
π Jifty::DBI::Collection::Unique π
okay bestie, welcome to the manual page for Jifty::DBI::Collection::Unique (that's the 3pm one, perl module territory, you already knew that tho). It's giving "tiny module, big save." Let's get into it. π¦
π NAME π
Jifty::DBI::Collection::Unique β literally just here to make sure the records in your collection are unique. No dupes. No doubles. Periodt. π
β¨ SYNOPSIS β¨
okay so here's the whole vibe, copy-paste ready:
package Foo::Collection;
use base 'Jifty::DBI::Collection';
use Jifty::DBI::Collection::Unique; # mixin
my $collection = Foo::Collection->New();
$collection->SetupComplicatedJoins;
$collection->OrderByMagic;
while (my $thing = $collection->Next) {
# $thing is going to be distinct
}
see how it's a mixin? you just use it and it slides right into your collection like it always belonged there. π«Ά
π« DESCRIPTION π«
So here's the tea, and it's lowkey a lil sad. π Right now, Jifty::DBI makes exceptions for databases that can't handle both SELECT DISTINCT and ordering in the same statement β and when that happens, it just drops the DISTINCT requirement. Which means... yeah. You can get the same row twice. Not the vibe you might be going for.
If that's your situation, use this module as a mix-in, and it will hand you an AddRecord method that makes sure a record will not appear twice in the same search. No cap. π
π₯ METHODS π₯
π add_record
Overrides add_record to ensure uniqueness. That's it, that's the whole job, and it does it flawlessly. π
heads up bestie: this is an override, so you're not getting the original add_record behaviour back β that's literally the point of the mixin. π
π AUTHOR π
Simon Cozens. iconic behaviour, we stan. πΈ
π COPYRIGHT π
Copyright 2005 Best Practical Solutions, LLC
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. (free software, as it should be π)
and that's the whole page, bestie β no notes, no skipped sections, no missing flags (there aren't any flags, it's a Perl module, we're off the hook π).
this lil doc came to you courtesy of perl v5.34.0, dated 2022-06-15 β bye diva, go make your records distinct πβ¨π¦
π¦ where this page comes from
- debian bookworm: libjifty-dbi-perl 0.78-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libjifty-dbi-perl 0.78-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libjifty-dbi-perl 0.78-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libjifty-dbi-perl 0.78-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libjifty-dbi-perl 0.78-3 Β· 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