Showing 4 changed files with 48 additions and 29 deletions
+2
Changes
... ...
@@ -1,4 +1,6 @@
1 1
 0.1686
2
+    - select() EXPERIMETNAL column option hash format
3
+      return table.column, not table__column
2 4
     - added EXPERIMENTAL col method.
3 5
     - set reserved_word_quote automatically from driver name
4 6
 0.1685
+19 -1
lib/DBIx/Custom.pm
... ...
@@ -877,7 +877,7 @@ sub select {
877 877
     if ($columns) {
878 878
         $columns = [$columns] unless ref $columns eq 'ARRAY';
879 879
         foreach my $column (@$columns) {
880
-            $column = $self->column(%$column) if ref $column eq 'HASH';
880
+            $column = $self->col(%$column) if ref $column eq 'HASH';
881 881
             unshift @$tables, @{$self->_search_tables($column)};
882 882
             push @sql, ($column, ',');
883 883
         }
... ...
@@ -1839,6 +1839,24 @@ Create assign tag.
1839 1839
 
1840 1840
 This is equal to C<update_param> exept that set is not added.
1841 1841
 
1842
+=head2 C<col> EXPERIMETNAL
1843
+
1844
+    my $column = $model->col(book => ['author', 'title']);
1845
+
1846
+Create column clause. The follwoing column clause is created.
1847
+
1848
+    book.author as "book.author",
1849
+    book.title as "book.title"
1850
+
1851
+=head2 C<column> EXPERIMETNAL
1852
+
1853
+    my $column = $dbi->column(book => ['author', 'title']);
1854
+
1855
+Create column clause. The follwoing column clause is created.
1856
+
1857
+    book.author as book__author,
1858
+    book.title as book__title
1859
+
1842 1860
 =head2 C<connect>
1843 1861
 
1844 1862
     my $dbi = DBIx::Custom->connect(
+26 -26
lib/DBIx/Custom/Model.pm
... ...
@@ -232,8 +232,8 @@ and implements the following new ones.
232 232
 
233 233
 =head2 C<column> EXPERIMETNAL
234 234
 
235
-    my $column = $self->column(book => ['author', 'title']);
236
-    my $column = $self->column('book');
235
+    my $column = $model->column(book => ['author', 'title']);
236
+    my $column = $model->column('book');
237 237
 
238 238
 Create column clause. The follwoing column clause is created.
239 239
 
... ...
@@ -244,8 +244,8 @@ If column names is omitted, C<columns> attribute of the model is used.
244 244
 
245 245
 =head2 C<col> EXPERIMETNAL
246 246
 
247
-    my $column = $self->col(book => ['author', 'title']);
248
-    my $column = $self->col('book');
247
+    my $column = $model->col(book => ['author', 'title']);
248
+    my $column = $model->col('book');
249 249
 
250 250
 Create column clause. The follwoing column clause is created.
251 251
 
... ...
@@ -268,13 +268,6 @@ you don't have to specify C<table> option.
268 268
 Same as C<delete_all()> of L<DBIx::Custom> except that
269 269
 you don't have to specify C<table> option.
270 270
 
271
-=head2 C<delete_at>
272
-
273
-    $table->delete_at(...);
274
-    
275
-Same as C<delete()> of L<DBIx::Custom> except that
276
-you don't have to specify C<table> and C<primary_key> option.
277
-
278 271
 =head2 C<insert>
279 272
 
280 273
     $table->insert(...);
... ...
@@ -282,13 +275,6 @@ you don't have to specify C<table> and C<primary_key> option.
282 275
 Same as C<insert()> of L<DBIx::Custom> except that
283 276
 you don't have to specify C<table> option.
284 277
 
285
-=head2 C<insert>
286
-
287
-    $table->insert_at(...);
288
-    
289
-Same as C<insert_at()> of L<DBIx::Custom> except that
290
-you don't have to specify C<table> and C<primary_key> option.
291
-
292 278
 =head2 C<method>
293 279
 
294 280
     $model->method(
... ...
@@ -335,13 +321,6 @@ Create a L<DBIx::Custom::Table> object.
335 321
 Same as C<select()> of L<DBIx::Custom> except that
336 322
 you don't have to specify C<table> option.
337 323
 
338
-=head2 C<select_at>
339
-
340
-    $table->select_at(...);
341
-    
342
-Same as C<select_at()> of L<DBIx::Custom> except that
343
-you don't have to specify C<table> and C<primary_key> option.
344
-
345 324
 =head2 C<update>
346 325
 
347 326
     $table->update(...);
... ...
@@ -356,9 +335,30 @@ you don't have to specify C<table> option.
356 335
 Same as C<update_all()> of L<DBIx::Custom> except that
357 336
 you don't have to specify table name.
358 337
 
359
-=head2 C<update_at>
338
+=head2 C<update_at> DEPRECATED!
360 339
 
361 340
     $table->update_at(...);
362 341
     
363 342
 Same as C<update_at()> of L<DBIx::Custom> except that
364 343
 you don't have to specify C<table> and C<primary_key> option.
344
+
345
+=head2 C<select_at> DEPRECATED!
346
+
347
+    $table->select_at(...);
348
+    
349
+Same as C<select_at()> of L<DBIx::Custom> except that
350
+you don't have to specify C<table> and C<primary_key> option.
351
+
352
+=head2 C<insert_at> DEPRECATED!
353
+
354
+    $table->insert_at(...);
355
+    
356
+Same as C<insert_at()> of L<DBIx::Custom> except that
357
+you don't have to specify C<table> and C<primary_key> option.
358
+
359
+=head2 C<delete_at> DEPRECATED!
360
+
361
+    $table->delete_at(...);
362
+    
363
+Same as C<delete()> of L<DBIx::Custom> except that
364
+you don't have to specify C<table> and C<primary_key> option.
+1 -2
t/dbix-custom-core-sqlite.t
... ...
@@ -2116,7 +2116,6 @@ $result = $model->select_at(
2116 2116
 );
2117 2117
 is_deeply($result->one,
2118 2118
           {key1 => 1, table2__key1 => 1});
2119
-
2120 2119
 $result = $model->select_at(
2121 2120
     column => [
2122 2121
         $model->mycolumn(['key1']),
... ...
@@ -2124,7 +2123,7 @@ $result = $model->select_at(
2124 2123
     ]
2125 2124
 );
2126 2125
 is_deeply($result->one,
2127
-          {key1 => 1, table2__key1 => 1});
2126
+          {key1 => 1, 'table2.key1' => 1});
2128 2127
 
2129 2128
 test 'dbi method from model';
2130 2129
 {