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 3     3   1249 use Mojo::Base -base;
  3         8  
  3         21  
3              
4 3     3   352 use Carp 'croak';
  3         6  
  3         1215  
5              
6             has 'dbi';
7              
8 0     0 0 0 sub current_database { croak "Unimplemented" }
9              
10             sub show_primary_keys {
11 5     5 0 19 my ($self, $database) = @_;
12              
13 5         33 my $tables = $self->show_tables($database);
14 5         18 my $primary_keys = {};
15 5         21 for my $table (@$tables) {
16 15         68 my $primary_key = $self->show_primary_key($database, $table);
17 15         73 $primary_keys->{$table} = $primary_key;
18             }
19 5         26 return $primary_keys;
20             }
21              
22 0     0 0 0 sub show_primary_key { croak "Unimplemented" }
23              
24             sub show_null_allowed_columns {
25 5     5 0 19 my ($self, $database) = @_;
26 5         32 my $tables = $self->show_tables($database);
27 5         22 my $null_allowed_columns = {};
28            
29 5         18 for my $table (@$tables) {
30 15         60 my $null_allowed_column = $self->show_null_allowed_column($database, $table);
31 15         49 $null_allowed_columns->{$table} = $null_allowed_column;
32             }
33 5         21 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 48     48 0 176 my ($self, $c) = @_;
61 48         215 my $params = $c->req->params->to_hash;
62 48         13727 return $params;
63             }
64              
65             1;