NAME
CPANDB::Distribution - CPANDB class for the distribution table
SYNOPSIS
TO BE COMPLETED
DESCRIPTION
TO BE COMPLETED
METHODS
select
# Get all objects in list context
my @list = CPANDB::Distribution->select;
# Get a subset of objects in scalar context
my $array_ref = CPANDB::Distribution->select(
'where distribution > ? order by distribution',
1000,
);
The select
method executes a typical SQL SELECT
query on the distribution table.
It takes an optional argument of a SQL phrase to be added after the FROM distribution
section of the query, followed by variables to be bound to the placeholders in the SQL phrase. Any SQL that is compatible with SQLite can be used in the parameter.
Returns a list of CPANDB::Distribution objects when called in list context, or a reference to an ARRAY
of CPANDB::Distribution objects when called in scalar context.
Throws an exception on error, typically directly from the DBI layer.
count
# How many objects are in the table
my $rows = CPANDB::Distribution->count;
# How many objects
my $small = CPANDB::Distribution->count(
'where distribution > ?',
1000,
);
The count
method executes a SELECT COUNT(*)
query on the distribution table.
It takes an optional argument of a SQL phrase to be added after the FROM distribution
section of the query, followed by variables to be bound to the placeholders in the SQL phrase. Any SQL that is compatible with SQLite can be used in the parameter.
Returns the number of objects that match the condition.
Throws an exception on error, typically directly from the DBI layer.
ACCESSORS
distribution
if ( $object->distribution ) {
print "Object has been inserted\n";
} else {
print "Object has not been inserted\n";
}
Returns true, or throws an exception on error.
REMAINING ACCESSORS TO BE COMPLETED
SQL
The distribution table was originally created with the following SQL command.
CREATE TABLE distribution (
distribution TEXT NOT NULL PRIMARY KEY,
version TEXT NULL,
author TEXT NOT NULL,
meta INTEGER NOT NULL,
license TEXT NULL,
release TEXT NOT NULL,
uploaded TEXT NOT NULL,
pass INTEGER NOT NULL,
fail INTEGER NOT NULL,
unknown INTEGER NOT NULL,
na INTEGER NOT NULL,
rating TEXT NULL,
ratings INTEGER NOT NULL,
weight INTEGER NOT NULL,
volatility INTEGER NOT NULL,
FOREIGN KEY (
author
)
REFERENCES author (
author
)
)
SUPPORT
CPANDB::Distribution is part of the CPANDB API.
See the documentation for CPANDB for more information.
COPYRIGHT
Copyright 2009 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.