Branch Coverage

blib/lib/Zonemaster/Backend/DB/SQLite.pm
Criterion Covered Total %
branch 15 32 46.8


line true false branch
26 2 0 if $self->dbh
35 0 1 unless $self->dbh->do('DROP TABLE IF EXISTS test_specs')
37 0 1 unless $self->dbh->do('DROP TABLE IF EXISTS test_results')
39 0 1 unless $self->dbh->do("CREATE TABLE test_results (\n\t\t\t\t\tid integer PRIMARY KEY AUTOINCREMENT,\n\t\t\t\t\tbatch_id integer NULL,\n\t\t\t\t\tcreation_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,\n\t\t\t\t\ttest_start_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,\n\t\t\t\t\ttest_end_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,\n\t\t\t\t\tpriority integer DEFAULT 10,\n\t\t\t\t\tqueue integer DEFAULT 0,\n\t\t\t\t\tprogress integer DEFAULT 0,\n\t\t\t\t\tparams_deterministic_hash character varying(32),\n\t\t\t\t\tparams text NOT NULL,\n\t\t\t\t\tresults text DEFAULT NULL\n\t\t\t)\n\t")
59 0 1 unless $self->dbh->do('DROP TABLE IF EXISTS batch_jobs')
61 0 1 unless $self->dbh->do("CREATE TABLE batch_jobs (\n\t\t\t\t\tid integer PRIMARY KEY,\n\t\t\t\t\tusername character varying(50) NOT NULL,\n\t\t\t\t\tcreation_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL\n\t\t\t)\n\t")
74 0 1 unless $self->dbh->do("CREATE TABLE users (\n\t\t\t\t\tid integer primary key,\n\t\t\t\t\tuser_info json DEFAULT NULL\n\t\t\t)\n\t")
92 0 0 if $user_info->{'username'} eq $user
115 0 0 if ($user_info->{'username'} eq $user and $user_info->{'api_key'} eq $api_key)
139 0 0 if $batch_id
152 0 2 if defined $test_params->{'priority'}
155 0 2 if defined $test_params->{'queue'}
183 112 12 if $progress
197 0 2 if $@
205 2 2 if $results
217 0 4 if $@