AbstractCount(3pm)

πŸ“¦
version 0.08 Β· 2 versions
  • 0.08 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.08 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ 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 (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