Branch Coverage

blib/lib/App/Milter/Limit/Plugin/SQLite.pm
Criterion Covered Total %
branch 6 28 21.4


line true false branch
63 0 2 unless my $dbh = 'DBI'->connect("dbi:SQLite:dbname=$db_file", '', '', {'PrintError', 0, 'AutoCommit', 1})
78 2 0 unless ($self->_table_exists($self->table))
86 0 2 if (defined $uid and defined $gid)
88 0 0 unless chown $uid, $gid, $db_file
97 0 0 if (my $dbh = $self->_dbh)
109 0 0 if (my $dbh = $self->_dbh)
121 0 0 unless (defined $rec)
123 0 0 unless $rec = $self->_create($from)
132 0 0 if ($start < time - $expire)
147 2 0 unless $self->_dbh->do("select 1 from $table limit 0")
159 0 2 unless $dbh->do("\n create table $table (\n sender varchar (255),\n first_seen timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n messages integer NOT NULL DEFAULT 0,\n PRIMARY KEY (sender)\n )\n ")
168 0 2 unless $dbh->do("\n create index ${table}_first_seen_key on $table (first_seen)\n ")
179 0 0 unless $self->_dbh->do("insert or replace into $table (sender) values (?)", undef, $sender)
220 0 0 unless $self->_dbh->do("\n update\n $table\n set\n messages = 1,\n first_seen = CURRENT_TIMESTAMP\n where\n sender = ?\n ", undef, $sender)