... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
0.1740 |
2 |
- - |
|
2 |
+ - execute method id option is DEPRECATED! |
|
3 | 3 |
0.1739 |
4 | 4 |
- insert timestamp option is DEPRECATED! |
5 | 5 |
use created_at option with now attribute |
... | ... |
@@ -426,11 +426,12 @@ sub execute { |
426 | 426 |
|
427 | 427 |
# Merge id to parameter |
428 | 428 |
if (defined $opt{id}) { |
429 |
+ my $statement = $query->statement; |
|
430 |
+ warn "execute method id option is DEPRECATED!" unless $statement; |
|
429 | 431 |
croak "execute id option must be specified with primary_key option" |
430 | 432 |
unless $opt{primary_key}; |
431 | 433 |
$opt{primary_key} = [$opt{primary_key}] unless ref $opt{primary_key}; |
432 | 434 |
$opt{id} = [$opt{id}] unless ref $opt{id}; |
433 |
- my $statement = $query->statement; |
|
434 | 435 |
for (my $i = 0; $i < @{$opt{primary_key}}; $i++) { |
435 | 436 |
my $key = $opt{primary_key}->[$i]; |
436 | 437 |
$key = "$main_table.$key" if $statement eq 'update' || |
... | ... |
@@ -2635,28 +2636,6 @@ registered by by C<register_filter>. |
2635 | 2636 |
This filter is executed before data is saved into database. |
2636 | 2637 |
and before type rule filter is executed. |
2637 | 2638 |
|
2638 |
-=item C<id> |
|
2639 |
- |
|
2640 |
- id => 4 |
|
2641 |
- id => [4, 5] |
|
2642 |
- |
|
2643 |
-ID corresponding to C<primary_key>. |
|
2644 |
-You can delete rows by C<id> and C<primary_key>. |
|
2645 |
- |
|
2646 |
- $dbi->execute( |
|
2647 |
- "select * from book where id1 = :id1 and id2 = :id2", |
|
2648 |
- {}, |
|
2649 |
- primary_key => ['id1', 'id2'], |
|
2650 |
- id => [4, 5], |
|
2651 |
- ); |
|
2652 |
- |
|
2653 |
-The above is same as the followin one. |
|
2654 |
- |
|
2655 |
- $dbi->execute( |
|
2656 |
- "select * from book where id1 = :id1 and id2 = :id2", |
|
2657 |
- {id1 => 4, id2 => 5} |
|
2658 |
- ); |
|
2659 |
- |
|
2660 | 2639 |
=item C<query> |
2661 | 2640 |
|
2662 | 2641 |
query => 1 |
... | ... |
@@ -2673,7 +2652,7 @@ You can check SQL, column, or get statment handle. |
2673 | 2652 |
primary_key => 'id' |
2674 | 2653 |
primary_key => ['id1', 'id2'] |
2675 | 2654 |
|
2676 |
-Priamry key. This is used when C<id> option find primary key. |
|
2655 |
+Priamry key. This is used for C<id> option. |
|
2677 | 2656 |
|
2678 | 2657 |
=item C<table> |
2679 | 2658 |
|
... | ... |
@@ -3464,6 +3443,7 @@ L<DBIx::Custom> |
3464 | 3443 |
update_param_tag # will be removed at 2017/1/1 |
3465 | 3444 |
|
3466 | 3445 |
# Options |
3446 |
+ execute method id option # will be removed 2017/1/1 |
|
3467 | 3447 |
update timestamp option # will be removed 2017/1/1 |
3468 | 3448 |
insert timestamp option # will be removed 2017/1/1 |
3469 | 3449 |
select method where_param option # will be removed 2017/1/1 |