AbstractCount(3pm)
β¨ NAME β¨
okay so bestie, meet Class::DBI::Plugin::AbstractCount π β it's the plugin that gets you COUNT(*) results with abstract SQL. no cap. (also, the manpage header calls this whole thing AbstractCount(3pm) from the User Contributed Perl Documentation, so that's the vibe π
)
πΈ SYNOPSIS πΈ
use base 'Class::DBI';
use Class::DBI::Plugin::AbstractCount;
my $count = Music::Vinyl->count_search_where(
{ artist => 'Frank Zappa'
, title => { like => '%Shut Up 'n Play Yer Guitar%' }
, released => { between => [ 1980, 1982 ] }
});
likeβ¦ look at her go π¦ one call, one number, zero drama.
π DESCRIPTION π
This Class::DBI plugin is literally a collab of two icons π :
- it steals the functionality from Class::DBI::Plugin::CountSearch β that's the counting-objects-without-having-to-use-an-array-or-an-iterator part β¨
- and it steals the functionality from Class::DBI::AbstractSearch β which is the part that lets you do complex where-clauses, a la SQL::Abstract π₯
put them together and it's giving effortless counting energy. periodt.
π METHODS π
π count_search_where
Takes a hashref with the abstract where-clause, bestie. and like, you can <em>also</em> pass an additional attribute hashref to influence the default behaviour: arrayrefs are OR'ed, hashrefs are AND'ed. that's the whole ruleset, slay π
π TODO π
- More tests, more doc.
(ngl, that's it. she's honest about it π)
π SEE ALSO π
- SQL::Abstract β for details about the where-clause and the attributes π
- Class::DBI::AbstractSearch
- Class::DBI::Plugin::CountSearch
π«Ά AUTHOR π«Ά
Jean-Christophe Zeus, <mail@jczeus.com> β with some help from Tatsuhiko Myagawa and Todd Holbrook π (group project, and they ate)
β COPYRIGHT AND LICENSE β
Copyright (C) 2004 by Jean-Christophe Zeus
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
π reminder bestie: that's the actual license, so don't be out here acting like you can just do whatever. same terms as Perl itself, fr fr.
and that's the whole page, mwah ππ
sign-off szn: this lil icon lives in perl v5.36.0, dated 2022-11-19, and it answers to the name AbstractCount(3pm) πβ¨
π¦ where this page comes from
- debian bookworm: libclass-dbi-plugin-abstractcount-perl 0.08-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libclass-dbi-plugin-abstractcount-perl 0.08-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libclass-dbi-plugin-abstractcount-perl 0.08-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libclass-dbi-plugin-abstractcount-perl 0.08-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libclass-dbi-plugin-abstractcount-perl 0.08-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