SQLite::Work

SQLite::Work is a perl module for interfacing with an SQLite database. I wrote this because I wanted a generic interface for the SQLite databases which I use on this site; I didn't want to have to keep on reinventing the wheel for each different database, but I wanted something which could be used to:

  • generate nice HTML reports, which
    • have nested headers
    • have grouped data which clusters under the headers
    • can be sorted on multiple columns
    • can be customized with templates (both headers and body) which include some simple formatting for column values, for example:
      • simple HTMLize
      • titles (Title,The becomes The Title)
      • names (Nurk,Fred becomes Fred Nurk)
      • month names
      • truncation
    • one can select the columns and their order even if one isn't using templates
    • default templates can be selected which present the data in tables, in paragraphs (Column:Value) or in lists.
    • can be split into multiple HTML pages, with automatic index-page generation; the split can be on the values of a given column, and/or by number of rows
  • use a generic search CGI script which
    • can search on all the fields in a table without having to hardcode the column names (it just gets them from the table information)
    • uses most of the power of the report engine to give nice search results
  • update the database with a CGI script
  • be able to mail reports to general addresses (such as a mailing list) or to specific addresses (such as sending notifications to individuals whose address is in the database).

The SQLite::Work::CGI module has extra methods which deal with CGI using the CGI module; the included "show.cgi" and "edit.cgi" are demonstration CGI scripts which use the SQLite::Work::CGI module.

The sqlreport script uses SQLite::Work to generate reports from the command-line.
Examples of pre-generated reports on this site can be seen at Net-Fic Reviews.

This module is released under the same conditions as Perl, that is, under Artistic Licence and the GNU General Public Licence.

This bundle is available on CPAN. Just go to my page on CPAN.