... | ... |
@@ -1,3 +1,5 @@ |
1 |
+0.1740 |
|
2 |
+ - |
|
1 | 3 |
0.1739 |
2 | 4 |
- insert timestamp option is DEPRECATED! |
3 | 5 |
use created_at option with now attribute |
... | ... |
@@ -1,7 +1,7 @@ |
1 | 1 |
package DBIx::Custom; |
2 | 2 |
use Object::Simple -base; |
3 | 3 |
|
4 |
-our $VERSION = '0.1738'; |
|
4 |
+our $VERSION = '0.1740'; |
|
5 | 5 |
use 5.008001; |
6 | 6 |
|
7 | 7 |
use Carp 'croak'; |
... | ... |
@@ -1144,6 +1144,8 @@ sub update_or_insert { |
1144 | 1144 |
croak qq{"table" option must be specified } . _subname |
1145 | 1145 |
unless defined $table; |
1146 | 1146 |
my $select_option = $opt{select_option}; |
1147 |
+ my $reuse = $opt{reuse}; |
|
1148 |
+ $opt{select_option}->{reuse} = $opt{reuse} if $opt{reuse}; |
|
1147 | 1149 |
|
1148 | 1150 |
my $rows = $self->select(table => $table, id => $id, |
1149 | 1151 |
primary_key => $primary_key, %$select_option)->all; |
... | ... |
@@ -2699,7 +2701,7 @@ on alias table name. |
2699 | 2701 |
|
2700 | 2702 |
=item C<reuse EXPERIMENTAL> |
2701 | 2703 |
|
2702 |
- reuse => $has_ref |
|
2704 |
+ reuse => $hash_ref |
|
2703 | 2705 |
|
2704 | 2706 |
Reuse query object if the hash reference variable is set. |
2705 | 2707 |
|
... | ... |
@@ -2756,21 +2758,16 @@ You can set this value to C<user_table_info>. |
2756 | 2758 |
=head2 C<helper> |
2757 | 2759 |
|
2758 | 2760 |
$dbi->helper( |
2759 |
- update_or_insert => sub { |
|
2760 |
- my $self = shift; |
|
2761 |
- |
|
2762 |
- # Process |
|
2763 |
- }, |
|
2764 | 2761 |
find_or_create => sub { |
2765 | 2762 |
my $self = shift; |
2766 | 2763 |
|
2767 | 2764 |
# Process |
2768 |
- } |
|
2765 |
+ }, |
|
2766 |
+ ... |
|
2769 | 2767 |
); |
2770 | 2768 |
|
2771 | 2769 |
Register helper. These helper is called directly from L<DBIx::Custom> object. |
2772 | 2770 |
|
2773 |
- $dbi->update_or_insert; |
|
2774 | 2771 |
$dbi->find_or_create; |
2775 | 2772 |
|
2776 | 2773 |
=head2 C<insert> |
... | ... |
@@ -3038,10 +3035,6 @@ Alias is quoted properly and joined. |
3038 | 3035 |
|
3039 | 3036 |
date(book.register_datetime) as "book.register_date" |
3040 | 3037 |
|
3041 |
-=item C<filter> |
|
3042 |
- |
|
3043 |
-Same as C<execute> method's C<filter> option. |
|
3044 |
- |
|
3045 | 3038 |
=item C<id> |
3046 | 3039 |
|
3047 | 3040 |
id => 4 |
... | ... |
@@ -148,6 +148,13 @@ my $model = DBIx::Custom::Model->new(table => 'books'); |
148 | 148 |
|
149 | 149 |
L<DBIx::Custom> object. |
150 | 150 |
|
151 |
+=head2 C<created_at EXPERIMENTAL> |
|
152 |
+ |
|
153 |
+ my $created_at = $model->created_at; |
|
154 |
+ $model = $model->created_at('created_datatime'); |
|
155 |
+ |
|
156 |
+Create timestamp column, this is passed to C<insert> or C<update> method. |
|
157 |
+ |
|
151 | 158 |
=head2 C<join> |
152 | 159 |
|
153 | 160 |
my $join = $model->join; |
... | ... |
@@ -181,6 +188,13 @@ Database data type, this is used as type optioon of C<insert>, |
181 | 188 |
C<update>, C<update_all>, C<delete>, C<delete_all>, |
182 | 189 |
C<select>, and C<execute> method |
183 | 190 |
|
191 |
+=head2 C<updated_at EXPERIMENTAL> |
|
192 |
+ |
|
193 |
+ my $updated_at = $model->updated_at; |
|
194 |
+ $model = $model->updated_at('updated_datatime'); |
|
195 |
+ |
|
196 |
+Updated timestamp column, this is passed to C<update> method. |
|
197 |
+ |
|
184 | 198 |
=head1 METHODS |
185 | 199 |
|
186 | 200 |
L<DBIx::Custom::Model> inherits all methods from L<Object::Simple>, |