Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Teng::Plugin::Count(3)User Contributed Perl DocumentatioTeng::Plugin::Count(3)

NAME
       Teng::Plugin::Count - Count rows	in database.

NAME
	   package MyDB;
	   use parent qw/Teng/;
	   __PACKAGE__->load_plugin('Count');

	   package main;
	   my $db = MyDB->new(...);
	   $db->count('user'); # => The	number of rows in 'user' table.
	   $db->count('user', '*', {type => 2}); # => SELECT COUNT(*) FROM user	WHERE type=2

DESCRIPTION
       This plugin provides shorthand for counting rows	in database.

METHODS
       $db->count($table[, $column[, \%where]])	: Int
	   $table table	name for counting

	   $column Column name for "COUNT(...)", the default value is '*'.

	   \%where : HashRef for creating where	clause.	The format is same as
	   "$db->select()". This parameter is optional.

	   Return: The number of rows.

perl v5.32.1			  2021-03-01		Teng::Plugin::Count(3)

NAME | NAME | DESCRIPTION | METHODS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Teng::Plugin::Count&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help