line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBIx::ActiveRecord::Arel::Query::Delete; |
2
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
65
|
|
3
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
47
|
|
4
|
2
|
|
|
2
|
|
10
|
use base 'DBIx::ActiveRecord::Arel::Query'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
465
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new { |
7
|
1
|
|
|
1
|
0
|
2
|
my ($self, $main) = @_; |
8
|
1
|
|
|
|
|
7
|
my $o = $self->SUPER::new($main); |
9
|
1
|
|
|
|
|
4
|
$o->merge($main->query); |
10
|
1
|
|
|
|
|
2
|
$o; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub _to_sql { |
14
|
1
|
|
|
1
|
|
2
|
my ($self) = @_; |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
|
|
1
|
$DBIx::ActiveRecord::Arel::Column::USE_FULL_NAME = 0; |
17
|
1
|
|
|
|
|
3
|
$DBIx::ActiveRecord::Arel::Column::AS = {}; |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
|
|
6
|
my $sql = 'DELETE FROM '.$self->main->table; |
20
|
1
|
|
|
|
|
6
|
my $where = $self->build_where; |
21
|
1
|
50
|
|
|
|
5
|
$sql .= " WHERE $where" if $where; |
22
|
1
|
|
|
|
|
4
|
$sql; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |