line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geoffrey::Action::View; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
23239
|
use utf8; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
40
|
|
4
|
5
|
|
|
5
|
|
229
|
use 5.016; |
|
5
|
|
|
|
|
19
|
|
5
|
5
|
|
|
5
|
|
24
|
use strict; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
101
|
|
6
|
5
|
|
|
5
|
|
24
|
use warnings; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
161
|
|
7
|
|
|
|
|
|
|
|
8
|
5
|
|
|
5
|
|
25
|
use parent 'Geoffrey::Role::Action'; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
32
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
$Geoffrey::Action::View::VERSION = '0.000204'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub add { |
13
|
3
|
|
|
3
|
1
|
1447
|
my ( $self, $params ) = @_; |
14
|
3
|
|
|
|
|
550
|
require Geoffrey::Utils; |
15
|
|
|
|
|
|
|
my $sql = Geoffrey::Utils::replace_spare( $self->converter->view->add, |
16
|
3
|
|
|
|
|
27
|
[ $params->{name}, $params->{as} ] ); |
17
|
3
|
|
|
|
|
20
|
return $self->do($sql); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub alter { |
21
|
2
|
|
|
2
|
1
|
7
|
my ( $self, $params ) = @_; |
22
|
2
|
|
|
|
|
62
|
return [ $self->drop( $params->{name} ), $self->add($params) ]; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub drop { |
26
|
4
|
|
|
4
|
1
|
981
|
my ( $self, $hr_params ) = @_; |
27
|
4
|
|
|
|
|
26
|
require Geoffrey::Utils; |
28
|
4
|
|
|
|
|
592
|
require Ref::Util; |
29
|
4
|
100
|
|
|
|
1791
|
my $s_name = Ref::Util::is_hashref($hr_params) ? delete $hr_params->{name} : $hr_params; |
30
|
4
|
100
|
|
|
|
14
|
if ( !$s_name ) { |
31
|
1
|
|
|
|
|
38
|
require Geoffrey::Exception::General; |
32
|
1
|
|
|
|
|
7
|
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
|
1360
|
my ( $self, $schema ) = @_; |
39
|
4
|
|
|
|
|
17
|
my $converter = $self->converter; |
40
|
4
|
|
|
|
|
18
|
return $converter->view_information( $self->do_arrayref( $converter->view->list($schema) ) ); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__END__ |