File Coverage

blib/lib/Mojolicious/Plugin/SQLiteViewerLite/Base/Command.pm
Criterion Covered Total %
statement 23 37 62.1
branch n/a
condition n/a
subroutine 5 13 38.4
pod 0 11 0.0
total 28 61 45.9


line stmt bran cond sub pod time code
1             package Mojolicious::Plugin::SQLiteViewerLite::Base::Command;
2 2     2   1590 use Mojo::Base -base;
  2         6  
  2         20  
3              
4 2     2   440 use Carp 'croak';
  2         6  
  2         1336  
5              
6             has 'dbi';
7              
8 0     0 0 0 sub current_database { croak "Unimplemented" }
9              
10             sub show_primary_keys {
11 4     4 0 15 my ($self, $database) = @_;
12              
13 4         94 my $tables = $self->show_tables($database);
14 4         13 my $primary_keys = {};
15 4         12 for my $table (@$tables) {
16 12         47 my $primary_key = $self->show_primary_key($database, $table);
17 12         50 $primary_keys->{$table} = $primary_key;
18             }
19 4         23 return $primary_keys;
20             }
21              
22 0     0 0 0 sub show_primary_key { croak "Unimplemented" }
23              
24             sub show_null_allowed_columns {
25 4     4 0 11 my ($self, $database) = @_;
26 4         30 my $tables = $self->show_tables($database);
27 4         13 my $null_allowed_columns = {};
28            
29 4         15 for my $table (@$tables) {
30 12         44 my $null_allowed_column = $self->show_null_allowed_column($database, $table);
31 12         32 $null_allowed_columns->{$table} = $null_allowed_column;
32             }
33 4         20 return $null_allowed_columns;
34             }
35              
36 0     0 0 0 sub show_null_allowed_column { croak "Unimplemented" }
37              
38             sub show_database_engines {
39 0     0 0 0 my ($self, $database) = @_;
40            
41 0         0 my $tables = $self->show_tables($database);
42 0         0 my $database_engines = {};
43 0         0 for my $table (@$tables) {
44 0         0 my $database_engine = $self->show_database_engine($database, $table);
45 0         0 $database_engines->{$table} = $database_engine;
46             }
47            
48 0         0 return $database_engines;
49             }
50              
51 0     0 0 0 sub show_database_engine { croak "Unimplemented" }
52              
53 0     0 0 0 sub show_databases { croak "Unimplemented" }
54              
55 0     0 0 0 sub show_tables { croak "Unimplemented" }
56              
57 0     0 0 0 sub show_create_table { croak "Unimplemented" }
58              
59             sub params {
60 39     39 0 96 my ($self, $c) = @_;
61 39         230 my $params = $c->req->params->to_hash;
62 39         10212 return $params;
63             }
64              
65             1;