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   2125 use Mojo::Base -base;
  3         37  
  3         22  
3              
4 3     3   482 use Carp 'croak';
  3         8  
  3         2086  
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 20 my ($self, $database) = @_;
12              
13 5         28 my $tables = $self->show_tables($database);
14 5         19 my $primary_keys = {};
15 5         20 for my $table (@$tables) {
16 15         63 my $primary_key = $self->show_primary_key($database, $table);
17 15         65 $primary_keys->{$table} = $primary_key;
18             }
19 5         27 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 23 my ($self, $database) = @_;
26 5         29 my $tables = $self->show_tables($database);
27 5         25 my $null_allowed_columns = {};
28            
29 5         21 for my $table (@$tables) {
30 15         100 my $null_allowed_column = $self->show_null_allowed_column($database, $table);
31 15         54 $null_allowed_columns->{$table} = $null_allowed_column;
32             }
33 5         22 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 155 my ($self, $c) = @_;
61 48         178 my $params = $c->req->params->to_hash;
62 48         13628 return $params;
63             }
64              
65             1;