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