| Rubric documentation | Contained in the Rubric distribution. |
Rubric::DBI - Rubric's subclass of Class::DBI
version 0.147
Rubric::DBI subclasses Class::DBI. It sets the connection by using the DSN retrieved from Rubric::Config.
This method performs periodic maintenance, cleaning up records that are no longer needed.
Ricardo SIGNES, <rjbs@cpan.org>
Please report any bugs or feature requests to bug-rubric@rt.cpan.org, or
through the web interface at http://rt.cpan.org. I will be notified, and
then you'll automatically be notified of progress on your bug as I make
changes.
Copyright 2004 Ricardo SIGNES. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Rubric documentation | Contained in the Rubric distribution. |
use strict; use warnings; package Rubric::DBI; our $VERSION = '0.147';
use Rubric::Config; use base qw(Class::DBI); use Class::DBI::AbstractSearch; DBI->trace(Rubric::Config->dbi_trace_level, Rubric::Config->dbi_trace_file); my $dsn = Rubric::Config->dsn; my $db_user = Rubric::Config->db_user; my $db_pass = Rubric::Config->db_pass; __PACKAGE__->connection( $dsn, $db_user, $db_pass, { AutoCommit => 1 } );
sub vacuum { my $self = shift; my $dbh = $self->db_Main; my $pruned_links = $dbh->do( "DELETE FROM links WHERE id NOT IN ( SELECT link FROM entries )" ); }
1;