line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geoffrey::Action::View; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
21729
|
use utf8; |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
33
|
|
4
|
5
|
|
|
5
|
|
215
|
use 5.016; |
|
5
|
|
|
|
|
18
|
|
5
|
5
|
|
|
5
|
|
26
|
use strict; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
100
|
|
6
|
5
|
|
|
5
|
|
24
|
use warnings; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
160
|
|
7
|
|
|
|
|
|
|
|
8
|
5
|
|
|
5
|
|
25
|
use parent 'Geoffrey::Role::Action'; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
38
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
$Geoffrey::Action::View::VERSION = '0.000205'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub add { |
13
|
3
|
|
|
3
|
1
|
1045
|
my ( $self, $params ) = @_; |
14
|
3
|
|
|
|
|
501
|
require Geoffrey::Utils; |
15
|
|
|
|
|
|
|
my $sql = Geoffrey::Utils::replace_spare( $self->converter->view->add, |
16
|
3
|
|
|
|
|
24
|
[ $params->{name}, $params->{as} ] ); |
17
|
3
|
|
|
|
|
18
|
return $self->do($sql); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub alter { |
21
|
2
|
|
|
2
|
1
|
7
|
my ( $self, $params ) = @_; |
22
|
2
|
|
|
|
|
58
|
return [ $self->drop( $params->{name} ), $self->add($params) ]; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub drop { |
26
|
4
|
|
|
4
|
1
|
866
|
my ( $self, $hr_params ) = @_; |
27
|
4
|
|
|
|
|
24
|
require Geoffrey::Utils; |
28
|
4
|
|
|
|
|
627
|
require Ref::Util; |
29
|
4
|
100
|
|
|
|
1777
|
my $s_name = Ref::Util::is_hashref($hr_params) ? delete $hr_params->{name} : $hr_params; |
30
|
4
|
100
|
|
|
|
14
|
if ( !$s_name ) { |
31
|
1
|
|
|
|
|
39
|
require Geoffrey::Exception::General; |
32
|
1
|
|
|
|
|
6
|
Geoffrey::Exception::General::throw_no_table_name('to drop'); |
33
|
|
|
|
|
|
|
} |
34
|
3
|
|
|
|
|
16
|
return $self->do( Geoffrey::Utils::replace_spare( $self->converter->view->drop, [$s_name] ) ); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub list_from_schema { |
38
|
4
|
|
|
4
|
1
|
1252
|
my ( $self, $schema ) = @_; |
39
|
4
|
|
|
|
|
19
|
my $converter = $self->converter; |
40
|
4
|
|
|
|
|
20
|
return $converter->view_information( $self->do_arrayref( $converter->view->list($schema) ) ); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__END__ |