|
NAMECPAN::SQLite - maintain and search a minimal CPAN databaseSYNOPSISmy $obj = CPAN::SQLite->new(CPAN => '/path/to/CPAN'); $obj->index(setup => 1); $obj->query(mode => 'dist', name => 'CPAN'); my $results = $obj->{results}; DESCRIPTIONThis package is used for setting up, maintaining, and searching a CPAN database consisting of the information stored in the three main CPAN indices: $CPAN/modules/03modlist.data.gz, $CPAN/modules/02packages.details.txt.gz, and $CPAN/authors/01mailrc.txt.gz. It should be considered at an alpha stage of development.One begins by creating the object as my $obj = CPAN::SQLite->new(%args); which accepts the following arguments:
There are two main methods available. "$obj->index(%args);"This is used to set up and maintain the database. The following arguments are accepted:
"$obj->query(%args);"This is used for querying the database by distribution name, module name, or CPAN author name. There are two arguments needed to specify such queries.
As well, an option of "max_results => some_number" will limit the number of results returned; if not specified, this defaults to 200. CPAN.pm supportAs of CPAN.pm version 1.88_65, there is experimental support within CPAN.pm for using CPAN::SQLite to obtain information on packages, modules, and authors. One goal of this is to reduce the memory footprint of the CPAN.pm shell, as this information is no longer all preloaded into memory. This can be enabled throughperl -MCPAN -e shell cpan> o conf use_sqlite 1 Use cpan> o conf commit to save this setting for future sessions. Using CPAN::SQLite, what happens is that a request for information through CPAN.pm, such as cpan> a ANDK will cause a query to the SQLite database to be made. If successful, this will place the relevant data for this request into the data structure CPAN.pm uses to store and retrieve such information. Thus, at any given time, the only information CPAN.pm stores in memory is that for packages, modules, and authors for which previous queries have been made. There are certain requests, such as cpan> r to make a list of recommended packages for which upgrades on CPAN are available, which will result in loading information on all available packages into memory; if such a query is made, the subsequent memory footprint of CPAN.pm with and without CPAN::SQLite will be essentially the same. The database itself, called cpandb.sql, will be stored in the location specified by "$CPAN::Config->{cpan_home}". When first started, this database will be created, and afterwards, it will be updated if the database is older than one day since the last update. A log file of the creation or update process, called cpan_search_log.dddddddddd, will be created in the same directory as the database file. SEE ALSOCPAN::SQLite::Index, for setting up and maintaining the database, and CPAN::SQLite::Search for an interface to querying the database. Some details of the interaction with CPAN is available from CPAN::SQLite::META. See also the cpandb script for a command-line interface to the indexing and querying of the database.Development takes place on the CPAN-Search-Lite project at <http://cpan-search.svn.sourceforge.net/viewvc/cpan-search/CPAN-SQLite/>. SUPPORTYou can find documentation for this module with the perldoc command.perldoc CPAN::SQLite You can also look for information at:
BUGSAt this time, CPAN::SQLite keeps information contained only in the latest version of a CPAN distribution. This means that modules that are provided only in older versions of a CPAN distribution will not be present in the database; for example, at this time, the latest version of the libwww-perl distribution on CPAN is 5.805, but there are modules such as URI::URL::finger contained in version 5.10 of libwww-perl that are not present in 5.805. This behaviour differs from that of CPAN without CPAN::SQLite. This may change in the future.Please report bugs and feature requests via <http://rt.cpan.org/NoAuth/Bugs.html?Dist=CPAN-SQLite>. ENVIRONMENT VARIABLESInformation messages from the indexing procedures are printed out to STDOUT if the environment variable CPAN_SQLITE_DEBUG is set. This is automatically set within CPAN::SQLite::Index. If CPAN_SQLITE_NO_LOG_FILES is set, no log files will be created during the indexing procedures.COPYRIGHTThis software is copyright 2006,2008 by Randy Kobes <r.kobes@uwinnipeg.ca>. Use and redistribution are under the same terms as Perl itself.
Visit the GSP FreeBSD Man Page Interface. |