CPAN::Testers::Schema - Schema for CPANTesters database processed from test reports
version 0.025
my $schema = CPAN::Testers::Schema->connect( $dsn, $user, $pass ); my $rs = $schema->resultset( 'Stats' )->search( { dist => 'Test-Simple' } ); for my $row ( $rs->all ) { if ( $row->state eq 'fail' ) { say sprintf "Fail report from %s: http://cpantesters.org/cpan/report/%s", $row->tester, $row->guid; } }
This is a DBIx::Class Schema for the CPANTesters statistics database. This database is generated by processing the incoming data from the CPANTesters Metabase, and extracting the useful fields like distribution, version, platform, and others (see CPAN::Testers::Schema::Result::Stats for a full list).
This is its own distribution so that it can be shared by the backend processing, data APIs, and the frontend web application.
my $schema = CPAN::Testers::Schema->connect_from_config( %extra_conf );
Connect to the MySQL database using a local MySQL configuration file in $HOME/.cpanstats.cnf. This configuration file should look like:
$HOME/.cpanstats.cnf
[client] host = "" database = cpanstats user = my_usr password = my_pwd
See "mysql_read_default_file" in DBD::mysql.
%extra_conf will be added to the "connect" in DBIx::Class::Schema method in the %dbi_attributes hashref (see "connect_info" in DBIx::Class::Storage::DBI).
%extra_conf
%dbi_attributes
Get the available schema versions by reading the files in the share directory. These versions can then be upgraded to using the cpantesters-schema script.
$schema->populate_from_api( \%search, @tables );
Populate the given tables from the CPAN Testers API (http://api.cpantesters.org). %search has the following keys:
%search
A distribution to populate
A distribution version to populate
Populate an author's data
The available @tables are:
@tables
upload
release
summary
report
CPAN::Testers::Schema::Result::Stats, DBIx::Class
Oriol Soriano <oriolsoriano@gmail.com>
Doug Bell <preaction@cpan.org>
Breno G. de Oliveira <garu@cpan.org>
Joel Berger <joel.a.berger@gmail.com>
Mohammad S Anwar <mohammad.anwar@yahoo.com>
Nick Tonkin <1nickt@users.noreply.github.com>
Paul Cochrane <paul@liekut.de>
This software is copyright (c) 2018 by Oriol Soriano, Doug Bell.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install CPAN::Testers::Schema, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CPAN::Testers::Schema
CPAN shell
perl -MCPAN -e shell install CPAN::Testers::Schema
For more information on module installation, please visit the detailed CPAN module installation guide.