... | ... |
@@ -1,4 +1,6 @@ |
1 |
-0.1644 |
|
1 |
+0.1635 |
|
2 |
+ renamed iterate_all_columns to each_column |
|
3 |
+0.1634 |
|
2 | 4 |
became more useful where method |
3 | 5 |
changed DBIx::Custom::Where greatly |
4 | 6 |
0.1633 |
... | ... |
@@ -1,6 +1,6 @@ |
1 | 1 |
package DBIx::Custom; |
2 | 2 |
|
3 |
-our $VERSION = '0.1634'; |
|
3 |
+our $VERSION = '0.1635'; |
|
4 | 4 |
|
5 | 5 |
use 5.008001; |
6 | 6 |
use strict; |
... | ... |
@@ -430,7 +430,7 @@ sub insert { |
430 | 430 |
return $ret_val; |
431 | 431 |
} |
432 | 432 |
|
433 |
-sub iterate_all_columns { |
|
433 |
+sub each_column { |
|
434 | 434 |
my ($self, $cb) = @_; |
435 | 435 |
|
436 | 436 |
# Iterate all tables |
... | ... |
@@ -462,12 +462,6 @@ sub new { |
462 | 462 |
return $self; |
463 | 463 |
} |
464 | 464 |
|
465 |
-sub or { |
|
466 |
- my $self = shift; |
|
467 |
- my $values = ref $_[0] eq 'ARRAY' ? $_[0] : [@_]; |
|
468 |
- return DBIx::Custom::Or->new(values => $values); |
|
469 |
-} |
|
470 |
- |
|
471 | 465 |
sub register_filter { |
472 | 466 |
my $invocant = shift; |
473 | 467 |
|
... | ... |
@@ -920,7 +914,15 @@ so all people learing database know it. |
920 | 914 |
If you already know SQL, |
921 | 915 |
you learn a little thing to use L<DBIx::Custom>. |
922 | 916 |
|
923 |
-See L<DBIx::Custom::Guides> for more details. |
|
917 |
+See L<DBIx::Custom::Guide> for more details. |
|
918 |
+ |
|
919 |
+=head1 GUIDE |
|
920 |
+ |
|
921 |
+L<DBIx::Custom::Guide> - L<DBIx::Custom> complete guide |
|
922 |
+ |
|
923 |
+=head1 EXAMPLES |
|
924 |
+ |
|
925 |
+L<DBIx::Custom Wiki|https://github.com/yuki-kimoto/DBIx-Custom/wiki> - Many useful examples |
|
924 | 926 |
|
925 | 927 |
=head1 ATTRIBUTES |
926 | 928 |
|
... | ... |
@@ -1201,25 +1203,24 @@ B<Example:> |
1201 | 1203 |
|
1202 | 1204 |
Create a new L<DBIx::Custom> object. |
1203 | 1205 |
|
1204 |
-=head2 C<(experimental) iterate_all_columns> |
|
1206 |
+=head2 C<(experimental) each_column> |
|
1205 | 1207 |
|
1206 |
- $dbi->iterate_all_columns( |
|
1208 |
+ $dbi->each_column( |
|
1207 | 1209 |
sub { |
1208 |
- my ($table, $column, $column_info) = @_; |
|
1210 |
+ my ($table, $column, $info) = @_; |
|
1209 | 1211 |
|
1210 |
- # do something; |
|
1212 |
+ my $type = $info->{TYPE_NAME}; |
|
1213 |
+ |
|
1214 |
+ if ($type eq 'DATE') { |
|
1215 |
+ # ... |
|
1216 |
+ } |
|
1211 | 1217 |
} |
1212 | 1218 |
); |
1213 |
- |
|
1214 |
-Iterate all columns of all tables. Argument is callback. |
|
1215 |
-You can do anything by callback. |
|
1216 |
- |
|
1217 |
-=head2 C<(experimental) or> |
|
1218 |
- |
|
1219 |
- $or = $dbi->or(1, 5); |
|
1220 |
- |
|
1221 |
-Create L<DBIx::Custom::Or> object. This is used with select method's |
|
1222 |
-where option. |
|
1219 |
+Get column informations from database. |
|
1220 |
+Argument is callback. |
|
1221 |
+You can do anything in callback. |
|
1222 |
+Callback receive three arguments, table name, column name and column |
|
1223 |
+information. |
|
1223 | 1224 |
|
1224 | 1225 |
=head2 C<register_filter> |
1225 | 1226 |
|
... | ... |
@@ -1,8 +1,8 @@ |
1 | 1 |
=head1 NAME |
2 | 2 |
|
3 |
-DBIx::Custom::Guides - DBIx::Custom Guides |
|
3 |
+DBIx::Custom::Guide - DBIx::Custom Guides |
|
4 | 4 |
|
5 |
-=head1 GUIDES |
|
5 |
+=head1 GUIDE |
|
6 | 6 |
|
7 | 7 |
=head2 1. Connect to the database |
8 | 8 |
|
... | ... |
@@ -538,7 +538,9 @@ These method can be called from L<DBIx::Custom> object directory. |
538 | 538 |
$dbi->update_or_insert; |
539 | 539 |
$dbi->find_or_create; |
540 | 540 |
|
541 |
-=head2 EXAMPLES |
|
541 |
+=head1 EXAMPLES |
|
542 |
+ |
|
543 |
+L<DBIx::Custom Wiki|https://github.com/yuki-kimoto/DBIx-Custom/wiki> - Many useful examples |
|
542 | 544 |
|
543 | 545 |
=head3 Limit clause |
544 | 546 |
|
... | ... |
@@ -2,7 +2,7 @@ |
2 | 2 |
|
3 | 3 |
=head1 NAME |
4 | 4 |
|
5 |
-DBIx::Custom::Guides::Ja - DBIx::Customの日本語ガイド |
|
5 |
+DBIx::Custom::Guide::Ja - DBIx::Customの日本語ガイド |
|
6 | 6 |
|
7 | 7 |
=head1 ガイド |
8 | 8 |
|
... | ... |
@@ -646,13 +646,13 @@ $result->filter({'key2' => 'twice'}); |
646 | 646 |
$rows = $result->fetch_hash_all; |
647 | 647 |
is_deeply($rows, [{key2 => 4, key3 => 18}], "$test : select : join : omit"); |
648 | 648 |
|
649 |
-test 'iterate_all_columns'; |
|
649 |
+test 'each_column'; |
|
650 | 650 |
$dbi = DBIx::Custom->connect($NEW_ARGS->{0}); |
651 | 651 |
$dbi->execute($CREATE_TABLE->{2}); |
652 | 652 |
$dbi->execute($CREATE_TABLE->{3}); |
653 | 653 |
|
654 | 654 |
$infos = []; |
655 |
-$dbi->iterate_all_columns(sub { |
|
655 |
+$dbi->each_column(sub { |
|
656 | 656 |
my ($table, $column, $cinfo) = @_; |
657 | 657 |
|
658 | 658 |
if ($table =~ /^table/) { |