App::SpamcupNG::Summary::Recorder - class to save Summary to SQLite3
use App::SpamcupNG::Summary::Recorder; # just pretend that $summary is an existing App::SpamcupNG::Summary instance my $recorder = App::SpamcupNG::Summary::Recorder->new( '/some/path/database_file' ); $recorder->init; $recorder->save($summary);
This class is used to persist App::SpamcupNG::Summary instances to a SQLite3 database.
Creates a new recorder instance.
Expects as parameter the complete path to a existing (or to create) SQLite 3 file.
Initialize the database if it doesn't exist yet. This is idempotent.
Persists a App::SpamcupNG::Summary instance to the database.
Returns "true" (in Perl terms) if everything goes fine.
Properly closes the SQLite 3 database file when the recorder instance goes out of scope.
This is a sample query to checkout records in the database:
SELECT A.id, A.tracking_id, DATETIME(A.created, 'unixepoch') AS CREATED, B.name AS CHARSET, C.name AS CONTENT_TYPE, A.age, D.name AS MAILER, E.report_id, F.email FROM summary A outer left join email_charset B on A.charset_id = B.id INNER JOIN email_content_type C ON A.content_type_id = C.id OUTER LEFT JOIN mailer D ON A.mailer_id = D.id INNER JOIN summary_receiver E ON A.id = E.summary_id INNER JOIN receiver F ON E.receiver_id = F.id;
https://www.sqlite.org/docs.html
To install App::SpamcupNG, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::SpamcupNG
CPAN shell
perl -MCPAN -e shell install App::SpamcupNG
For more information on module installation, please visit the detailed CPAN module installation guide.