Showing 3 changed files with 15 additions and 211 deletions
+3 -210
Changes
... ...
@@ -1,4 +1,6 @@
1 1
 0.1684
2
+
3
+    - select() column option can receive hash reference
2 4
     - update_param_tag is DEPRECATED! use update_param instead.
3 5
     - insert_param_tag is DEPRECATED! use insert_param instead.
4 6
     - assing_param_tag is DEPRECATED! use assign_param instead.
... ...
@@ -175,213 +177,4 @@
175 177
     - renamed dbi_options to dbi_option. dbi_options is available, but deprecated.
176 178
     - renamed DBIx::Custom::TagProcessor to DBIx::Custom::Tag, and function names is cleanuped.
177 179
     - renamed register_tag_processor to register_tag. register_tag_processor is available, but deprecated.
178
-    - renamed tag_processors to tags. tag_prosessors is available, but deprecated.
179
-    - improved error message
180
-    - build all clause if param is undefined.
181
-    - each_column callback receive self as first argument.
182
-    - removed EXPERIMENTAL txn_scope
183
-0.1636
184
-    - added tests and cleanup
185
-0.1635
186
-    - renamed iterate_all_columns to each_column
187
-0.1634
188
-    - became more useful where method
189
-    - changed DBIx::Custom::Where greatly
190
-0.1633
191
-    - fixed test
192
-0.1632
193
-    - added EXPERIMENTAL where method
194
-    - added EXPERIMENTAL DBIx::Custom::Where.
195
-    - removed DBIx::Custom::Or
196
-0.1631
197
-    - added EXPERIMENTAL DBIx::Custom::Result end_filter method
198
-    - EXPERIMENTAL extended select method's where option
199
-    - fix select method empty where failed bug
200
-    - added EXPERIMENTAL suger method query option
201
-    - added EXPERIMENTAL or method
202
-0.1630
203
-    - fix test bug
204
-0.1629
205
-    - renamed auto_filter to apply_filter
206
-    - changed apply_filter method arguments
207
-    - deprecated cache_method
208
-0.1628
209
-    - remove DBIx::Custom::Model
210
-    - move table method and table_class attribute to DBIx::Custom
211
-    - added examples
212
-    - fixed connect method bug
213
-0.1627
214
-    - added insert, update, update_all, delete, delete_all, select method to DBIx::Custom::Table
215
-    - added EXPERIMENTAL txn_scope
216
-0.1626
217
-    - simplified DBIx::Custom::Model and DBIx::Custom::Table
218
-0.1625
219
-    - added EXPERIMENTAL DBIx::Custom::Model and DBIx::Custom::Table
220
-0.1624
221
-    - added EXPERIMENTAL iterate_all_columns method.
222
-0.1623
223
-    - added EXPERIMENTAL auto_filter method
224
-    - deprecated default_bind_filter and default_fetch_filter because these are global effect.
225
-    - changed defautl_bind_filter and default_fetch_filter attributes to methods.
226
-    - changed DBIx::Custom::Result default_filter attribute to method
227
-    - changed DBIx::Custom::Result filter attribute to method.
228
-    - filter_check is always done for usability
229
-0.1622
230
-    - deprecated DBIx::Custom::SQLite and DBIx::Custom::MySQL
231
-    - added dbi_options attribute
232
-    - checked attributes passed to connect method
233
-0.1621
234
-    - cleanup (removed undocumented features)
235
-0.1620
236
-    - updated document
237
-0.1619
238
-    - updated document
239
-    - added EXPERIMENTAL expand method
240
-0.1618
241
-    - added helper method
242
-    - added begin_work, commit, and rollback method
243
-0.1617
244
-    - L<DBIx::Custom> is now stable. APIs keep backword compatible in the feature.
245
-0.1616
246
-    - removed EXPERIMENTAL register_method(), and methods attribute, because it is too magical
247
-0.1615
248
-    - fixed DBIx::Custom::QueryBuilder build_query() bug
249
-    - required Perl 5.008001 to use @CARP_NOT 
250
-0.1614
251
-    - removed DBIx::Custom::Query start_tag and end tag attributes
252
-    - enable escaping '{' and '}' in the source of SQL
253
-    - fixed Carp Carp trust relationship
254
-0.1613
255
-    - added EXPERIMENTAL register_method() method
256
-    - added EXPERIMENTAL methods attribute
257
-0.1612
258
-    - added tests
259
-    - updated document
260
-    - removed DBIx::Custom::SQLite last_insert_rawid() mehtod(not backword compatible)
261
-    - removed DBIx::Custom::MySQL last_insert_id() method(not backword compatible)
262
-0.1611
263
-    - renamed update tag to update_param
264
-    - renamed insert tag to insert_param
265
-    - renamed sql_builder to query_builder
266
-0.1610
267
-    - added filter_check attribute.
268
-0.1609
269
-    - updated document.
270
-0.1608
271
-    - update document
272
-    - renamed DBIx::Custom::QueryBuilder::TagProcessors functions(not backword compatible)
273
-0.1607
274
-    - where argument of select() method can specify array(string, parameters)
275
-    - renamed build_query() to create_query()(not backword compatible)
276
-0.1606
277
-    - fix testing bug
278
-0.1605
279
-    - remove DBIx::Custom::QueryBuilder::tag_syntax()  (not backword compatible)
280
-    - renamed DBIx::Custom::TagProcessor to DBIx::Custom::TagProcessors (not backword compatible)
281
-    - changed arguments of tag processor(not backword compatible)
282
-    - renamed DBIx::Custom::QueryBuilder::TagProcessors functions(not backword compatible)
283
-0.1604
284
-    - changed argument of tag processor(not backword compatible)
285
-    - renamed default_query_filter to default_bind_filter(not backword compatible)
286
-    - renamed DBIx::Custom::SQLTemplate to DBIx::Custom::SQLBuilder(not backword compatible)
287
-    - renamed create_query to build_query(not backword compatible)
288
-    - renamed sql_template to sql_builder(not backword compatible)
289
-    - removed DESTROY method(not backword compatible)
290
-    - removed disconnect method(not backword compatible)
291
-    - fixed DBIx::Custom::MySQL connect_memory
292
-0.1603
293
-    - removed DBIx::Custom commit method (not backword compatible)
294
-    - removed DBIx::Custom rollback method (not backword compatible)
295
-    - removed DBIx::Custom auto_commit method (not backword compatible)
296
-0.1602
297
-    - added cache_method attribute
298
-0.1601
299
-    - added cache attribute
300
-    - select, insert, update, update_all, delete, delete_all, execute only receive hash argument(not backword compatible)
301
-0.1503
302
-    - removed reconnect method
303
-    - removed connected method
304
-    - removed reconnect_memroy method
305
-    - renamed fetch_single to fetch_first
306
-    - renamed fetch_hash_single to fetch_hash_first
307
-    - updated document
308
-0.1502
309
-    - added commit method
310
-    - added rollback method
311
-    - changed select argument, added relation option
312
-    - moved host attribute to DBIx::Custom::MySQL
313
-    - moved port attribute to DBIx::Custom::MySQL
314
-    - moved database attribute to DBIx::Custom::MySQL and DBIx::Custom::SQLite
315
-0.1501
316
-    - removed register_format()
317
-    - removed formats()
318
-    - removed run_transaction()
319
-    - removed create_table()
320
-    - removed drop_table()
321
-    - changed select() arguments
322
-    - changed insert() arguments
323
-    - changed update() arguments
324
-    - changed update_all() arguments
325
-    - changed delete() arguments
326
-    - changed delete_all() arguments
327
-    - changed execute() arguments
328
-0.1402
329
-    - remove finish(), error()
330
-    - can receive code ref to filter()
331
-    - renamed resist to register
332
-0.1401
333
-    - renamed fetch_rows to fetch_multi
334
-    - renamed fetch_hash_rows to fetch_hash_multi
335
-0.1301
336
-    - Changed many(not backword compatible)
337
-0.1201
338
-    - Changed many(not backword compatible)
339
-0.1101
340
-    - rename DBIx::Custom::SQLite last_insert_id to last_insert_rowid
341
-0.1001
342
-    - remove run_transaction().
343
-    - add transaction() and DBIx::Custom::Transaction
344
-    - rename fetch_first to fetch_single
345
-    - rename fetch_hash_first to fetch_hash_single
346
-0.0906
347
-    - fix some bug
348
-0.0905
349
-    - catch up with Object::Simple update
350
-0.0904
351
-    - cleanup
352
-0.0903
353
-    - catch up with Object::Simple update
354
-0.0902
355
-    - cleanup
356
-0.0901
357
-    - DBIx::Basic filter 'encode_utf8' utf8::upgrade process is deleted
358
-0.0801
359
-    - add 'create_table', 'drop_table' methods
360
-0.0701
361
-    - rename sql_template to sql_tmpl (not backword compatible)
362
-    - rename dbi_options to options (not backword compatible)
363
-0.0605
364
-    - fix encode_utf8 filter
365
-0.0604
366
-    - fix timeformat tests
367
-0.0603
368
-    - fix cache system bug
369
-0.0602
370
-    - update document
371
-0.0601
372
-    - bind_filter argument is changed to ($value, $key, $dbi, $infos) (not backword compatible)
373
-    - fetch_filter argument is changed to ($value, $key, $dbi, $infos) (not backword compatible)
374
-    - run_transaction argument is changed to ($dbi)
375
-0.0502
376
-    - update document
377
-0.0501
378
-    - packaging DBIx::Custom::Result DBIx::Custom::Query DBIx::Custom::MySQL DBIx::Custom::SQLite DBIx::Custom::SQL::Template 
379
-0.0401
380
-    - catch up with DBIx::Custom::Result version up
381
-0.0301
382
-    - exchange filter argument 'key', 'value' (not backword compatible)
383
-0.0201
384
-    - rename tranzaction to transaction
385
-    - add filter_off
386
-0.0101
387
-    - First release
180
+    - renamed tag_processors to tags. tag_prosessors is available, but deprecated
+2 -1
lib/DBIx/Custom.pm
... ...
@@ -869,8 +869,9 @@ sub select {
869 869
     
870 870
     # Column clause
871 871
     if ($columns) {
872
-        $columns = [$columns] if ! ref $columns;
872
+        $columns = [$columns] unless ref $columns eq 'ARRAY';
873 873
         foreach my $column (@$columns) {
874
+            $column = $self->column(%$column) if ref $column eq 'HASH';
874 875
             unshift @$tables, @{$self->_search_tables($column)};
875 876
             push @sql, ($column, ',');
876 877
         }
+10
t/dbix-custom-core-sqlite.t
... ...
@@ -2057,6 +2057,7 @@ $result = $model->select_at(
2057 2057
 );
2058 2058
 is_deeply($result->fetch_hash_first,
2059 2059
           {key1 => 1, key2 => 2, table2__key1 => 1, table2__key3 => 3});
2060
+
2060 2061
 $result = $model->select_at(
2061 2062
     column => [
2062 2063
         $model->mycolumn(['key1']),
... ...
@@ -2066,6 +2067,15 @@ $result = $model->select_at(
2066 2067
 is_deeply($result->fetch_hash_first,
2067 2068
           {key1 => 1, table2__key1 => 1});
2068 2069
 
2070
+$result = $model->select_at(
2071
+    column => [
2072
+        $model->mycolumn(['key1']),
2073
+        {table2 => ['key1']}
2074
+    ]
2075
+);
2076
+is_deeply($result->fetch_hash_first,
2077
+          {key1 => 1, table2__key1 => 1});
2078
+
2069 2079
 test 'dbi method from model';
2070 2080
 {
2071 2081
     package MyDBI9;