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