Showing 1 changed files with 43 additions and 43 deletions
+43 -43
t/common.t
... ...
@@ -2375,7 +2375,7 @@ $dbi = DBIx::Custom->connect;
2375 2375
 eval { $dbi->execute("drop table $table1") };
2376 2376
 $dbi->execute($create_table1);
2377 2377
 $dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
2378
-$dbi->insert(table => $table1, param => {$key1 => 2, $key2 => 3});
2378
+$dbi->insert({$key1 => 2, $key2 => 3}, table => $table1);
2379 2379
 $dbi->delete(
2380 2380
     table => $table1,
2381 2381
     where => [
... ...
@@ -2393,8 +2393,8 @@ eval { $dbi->execute("drop table $table1") };
2393 2393
 $dbi->execute($create_table1);
2394 2394
 $dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
2395 2395
 $dbi->update(
2396
+    {$key1 => 5},
2396 2397
     table => $table1,
2397
-    param => {$key1 => 5},
2398 2398
     where => "$key1 = :$key1 and $key2 = :$key2",
2399 2399
     where_param => {$key1 => 1, $key2 => 2}
2400 2400
 );
... ...
@@ -2517,22 +2517,22 @@ eval { $dbi->execute("drop table $table1") };
2517 2517
 $dbi->execute($create_table1_2);
2518 2518
 $dbi->insert({$key1 => 1, $key2 => 2, $key3 => 3}, table => $table1);
2519 2519
 $dbi->update(
2520
+    {$key3 => 4},
2520 2521
     table => $table1,
2521 2522
     primary_key => [$key1, $key2],
2522 2523
     id => [1, 2],
2523
-    param => {$key3 => 4}
2524 2524
 );
2525 2525
 is($dbi->select(table => $table1)->one->{$key1}, 1);
2526 2526
 is($dbi->select(table => $table1)->one->{$key2}, 2);
2527 2527
 is($dbi->select(table => $table1)->one->{$key3}, 4);
2528 2528
 
2529 2529
 $dbi->delete_all(table => $table1);
2530
-$dbi->insert(table => $table1, param => {$key1 => 0, $key2 => 2, $key3 => 3});
2530
+$dbi->insert({$key1 => 0, $key2 => 2, $key3 => 3}, table => $table1);
2531 2531
 $dbi->update(
2532
+    {$key3 => 4},
2532 2533
     table => $table1,
2533 2534
     primary_key => $key1,
2534 2535
     id => 0,
2535
-    param => {$key3 => 4}
2536 2536
 );
2537 2537
 is($dbi->select(table => $table1)->one->{$key1}, 0);
2538 2538
 is($dbi->select(table => $table1)->one->{$key2}, 2);
... ...
@@ -2559,8 +2559,8 @@ eval { $dbi->execute("drop table $table1") };
2559 2559
 $dbi->execute($create_table1_2);
2560 2560
 $dbi->insert({$key1 => 1, $key2 => 2, $key3 => 3}, table => $table1);
2561 2561
 $dbi->model($table1)->update(
2562
+    {$key3 => 4},
2562 2563
     id => [1, 2],
2563
-    param => {$key3 => 4}
2564 2564
 );
2565 2565
 $result = $dbi->model($table1)->select;
2566 2566
 $row = $result->one;
... ...
@@ -2581,7 +2581,7 @@ $dbi->delete(
2581 2581
 );
2582 2582
 is_deeply($dbi->select(table => $table1)->all, []);
2583 2583
 
2584
-$dbi->insert(table => $table1, param => {$key1 => 0, $key2 => 2, $key3 => 3});
2584
+$dbi->insert({$key1 => 0, $key2 => 2, $key3 => 3}, table => $table1);
2585 2585
 $dbi->delete(
2586 2586
     table => $table1,
2587 2587
     primary_key => $key1,
... ...
@@ -2601,10 +2601,10 @@ $dbi->execute($create_table3);
2601 2601
 $dbi->insert({$key1 => 1, $key2 => 2, $key3 => 3}, table => $table1);
2602 2602
 $dbi->model($table1)->delete(id => [1, 2]);
2603 2603
 is_deeply($dbi->select(table => $table1)->all, []);
2604
-$dbi->insert(table => $table2, param => {$key1 => 1, $key2 => 2, $key3 => 3});
2604
+$dbi->insert({$key1 => 1, $key2 => 2, $key3 => 3}, table => $table2);
2605 2605
 $dbi->model($table1)->delete(id => [1, 2]);
2606 2606
 is_deeply($dbi->select(table => $table1)->all, []);
2607
-$dbi->insert(table => $table3, param => {$key1 => 1, $key2 => 2, $key3 => 3});
2607
+$dbi->insert({$key1 => 1, $key2 => 2, $key3 => 3}, table => $table3);
2608 2608
 $dbi->model($table3)->delete(id => [1, 2]);
2609 2609
 is_deeply($dbi->select(table => $table3)->all, []);
2610 2610
 
... ...
@@ -2625,7 +2625,7 @@ is($row->{$key2}, 2);
2625 2625
 is($row->{$key3}, 3);
2626 2626
 
2627 2627
 $dbi->delete_all(table => $table1);
2628
-$dbi->insert(table => $table1, param => {$key1 => 0, $key2 => 2, $key3 => 3});
2628
+$dbi->insert({$key1 => 0, $key2 => 2, $key3 => 3}, table => $table1);
2629 2629
 $result = $dbi->select(
2630 2630
     table => $table1,
2631 2631
     primary_key => $key1,
... ...
@@ -2669,7 +2669,7 @@ $dbi->execute($create_table1);
2669 2669
 $dbi->execute($create_table2);
2670 2670
 $dbi->setup_model;
2671 2671
 $dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
2672
-$dbi->insert(table => $table2, param => {$key1 => 1, $key3 => 3});
2672
+$dbi->insert({$key1 => 1, $key3 => 3}, table => $table2);
2673 2673
 $model = $dbi->model($table1);
2674 2674
 $result = $model->select(
2675 2675
     column => [$model->column($table2)],
... ...
@@ -2705,7 +2705,7 @@ $model2 = $dbi->create_model(
2705 2705
 );
2706 2706
 $dbi->setup_model;
2707 2707
 $dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
2708
-$dbi->insert(table => $table2, param => {$key1 => 1, $key3 => 3});
2708
+$dbi->insert({$key1 => 1, $key3 => 3}, table => $table2);
2709 2709
 $model = $dbi->model($table1);
2710 2710
 $result = $model->select(
2711 2711
     column => [
... ...
@@ -3043,24 +3043,24 @@ $dbi->insert({$key1 => 1, $key2 => 2, $key3 => 3, $key4 => 4, $key5 => 5}, table
3043 3043
 $dbi->insert({$key1 => 6, $key2 => 7, $key3 => 8, $key4 => 9, $key5 => 10}, table => $table1);
3044 3044
 
3045 3045
 $source = "select * from $table1 where :${key1}{=} and :${key2}{=}";
3046
-$result = $dbi->execute($source, param => {$key1 => 1, $key2 => 2});
3046
+$result = $dbi->execute($source, {$key1 => 1, $key2 => 2});
3047 3047
 $rows = $result->all;
3048 3048
 is_deeply($rows, [{$key1 => 1, $key2 => 2, $key3 => 3, $key4 => 4, $key5 => 5}]);
3049 3049
 
3050 3050
 $source = "select * from $table1 where :${key1}{ = } and :${key2}{=}";
3051
-$result = $dbi->execute($source, param => {$key1 => 1, $key2 => 2});
3051
+$result = $dbi->execute($source, {$key1 => 1, $key2 => 2});
3052 3052
 $rows = $result->all;
3053 3053
 is_deeply($rows, [{$key1 => 1, $key2 => 2, $key3 => 3, $key4 => 4, $key5 => 5}]);
3054 3054
 
3055 3055
 $source = "select * from $table1 where :${key1}{<} and :${key2}{=}";
3056
-$result = $dbi->execute($source, param => {$key1 => 5, $key2 => 2});
3056
+$result = $dbi->execute($source, {$key1 => 5, $key2 => 2});
3057 3057
 $rows = $result->all;
3058 3058
 is_deeply($rows, [{$key1 => 1, $key2 => 2, $key3 => 3, $key4 => 4, $key5 => 5}]);
3059 3059
 
3060 3060
 $source = "select * from $table1 where :$table1.${key1}{=} and :$table1.${key2}{=}";
3061 3061
 $result = $dbi->execute(
3062 3062
     $source,
3063
-    param => {"$table1.$key1" => 1, "$table1.$key2" => 1},
3063
+    {"$table1.$key1" => 1, "$table1.$key2" => 1},
3064 3064
     filter => {"$table1.$key2" => sub { $_[0] * 2 }}
3065 3065
 );
3066 3066
 $rows = $result->all;
... ...
@@ -3372,7 +3372,7 @@ $dbi->user_table_info($user_table_info);
3372 3372
 eval { $dbi->execute("drop table $table1") };
3373 3373
 $dbi->execute($create_table1);
3374 3374
 $dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
3375
-$dbi->insert(table => $table1, param => {$key1 => 2, $key2 => 3});
3375
+$dbi->insert({$key1 => 2, $key2 => 3}, table => $table1);
3376 3376
 $rows = $dbi->select(
3377 3377
     table => $table1,
3378 3378
     column => $key1,
... ...
@@ -3390,7 +3390,7 @@ $dbi->user_table_info($user_table_info);
3390 3390
 eval { $dbi->execute("drop table $table1") };
3391 3391
 $dbi->execute($create_table1);
3392 3392
 $dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
3393
-$dbi->insert(table => $table1, param => {$key1 => 2, $key2 => 3});
3393
+$dbi->insert({$key1 => 2, $key2 => 3}, table => $table1);
3394 3394
 $rows = $dbi->select(
3395 3395
     table => $table1,
3396 3396
     column => $key1,
... ...
@@ -3477,7 +3477,7 @@ $dbi->create_model(
3477 3477
 );
3478 3478
 $dbi->setup_model;
3479 3479
 $dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
3480
-$dbi->insert(table => $table2, param => {$key1 => 1, $key3 => 3});
3480
+$dbi->insert({$key1 => 1, $key3 => 3}, table => $table2);
3481 3481
 $model = $dbi->model($table1);
3482 3482
 $result = $model->select(
3483 3483
     column => [$model->mycolumn, $model->column($table2)],
... ...
@@ -3491,7 +3491,7 @@ test 'model method';
3491 3491
 $dbi = DBIx::Custom->connect;
3492 3492
 eval { $dbi->execute("drop table $table2") };
3493 3493
 $dbi->execute($create_table2);
3494
-$dbi->insert(table => $table2, param => {$key1 => 1, $key3 => 3});
3494
+$dbi->insert({$key1 => 1, $key3 => 3}, table => $table2);
3495 3495
 $model = $dbi->create_model(
3496 3496
     table => $table2
3497 3497
 );
... ...
@@ -3502,7 +3502,7 @@ test 'model helper';
3502 3502
 $dbi = DBIx::Custom->connect;
3503 3503
 eval { $dbi->execute("drop table $table2") };
3504 3504
 $dbi->execute($create_table2);
3505
-$dbi->insert(table => $table2, param => {$key1 => 1, $key3 => 3});
3505
+$dbi->insert({$key1 => 1, $key3 => 3}, table => $table2);
3506 3506
 $model = $dbi->create_model(
3507 3507
     table => $table2
3508 3508
 );
... ...
@@ -3522,7 +3522,7 @@ $sql = <<"EOS";
3522 3522
 update $table1 set $assign_clause
3523 3523
 where $key1 = 1
3524 3524
 EOS
3525
-$dbi->execute($sql, param => $param);
3525
+$dbi->execute($sql, $param);
3526 3526
 $result = $dbi->execute("select * from $table1 order by $key1", table => $table1);
3527 3527
 $rows   = $result->all;
3528 3528
 is_deeply($rows, [{$key1 => 1, $key2 => 11, $key3 => 3, $key4 => 4, $key5 => 5},
... ...
@@ -3542,7 +3542,7 @@ $sql = <<"EOS";
3542 3542
 update $table1 set $assign_clause
3543 3543
 where $key1 = 1
3544 3544
 EOS
3545
-$dbi->execute($sql, param => $param);
3545
+$dbi->execute($sql, $param);
3546 3546
 $result = $dbi->execute("select * from $table1 order by $key1", table => $table1);
3547 3547
 $rows   = $result->all;
3548 3548
 is_deeply($rows, [{$key1 => 1, $key2 => 11, $key3 => 33, $key4 => 4, $key5 => 5},
... ...
@@ -3561,7 +3561,7 @@ $sql = <<"EOS";
3561 3561
 update $table1 set $assign_clause
3562 3562
 where $key1 = 1
3563 3563
 EOS
3564
-$dbi->execute($sql, param => $param);
3564
+$dbi->execute($sql, $param);
3565 3565
 $result = $dbi->execute("select * from $table1 order by $key1", table => $table1);
3566 3566
 $rows   = $result->all;
3567 3567
 is_deeply($rows, [{$key1 => 1, $key2 => 11, $key3 => 33, $key4 => 4, $key5 => 5},
... ...
@@ -3584,7 +3584,7 @@ $sql = <<"EOS";
3584 3584
 update $table1 set $assign_clause
3585 3585
 where $key1 = 1
3586 3586
 EOS
3587
-$dbi->execute($sql, param => $param, table => $table1);
3587
+$dbi->execute($sql, $param, table => $table1);
3588 3588
 $result = $dbi->execute("select * from $table1 order by $key1");
3589 3589
 $rows   = $result->all;
3590 3590
 is_deeply($rows, [{$key1 => 1, $key2 => 11, $key3 => 3, $key4 => 4, $key5 => 5},
... ...
@@ -3597,7 +3597,7 @@ $sql = <<"EOS";
3597 3597
 update $table1 set $assign_clause
3598 3598
 where $key1 = 1
3599 3599
 EOS
3600
-$dbi->execute($sql, param => $param, table => $table1);
3600
+$dbi->execute($sql, $param, table => $table1);
3601 3601
 $result = $dbi->execute("select * from $table1 order by $key1");
3602 3602
 $rows   = $result->all;
3603 3603
 is_deeply($rows, [{$key1 => 1, $key2 => 11, $key3 => 3, $key4 => 4, $key5 => 5},
... ...
@@ -3639,7 +3639,7 @@ $dbi->execute($create_table2);
3639 3639
 $model = $dbi->model($table2);
3640 3640
 $model->insert({$key1 => 'a'});
3641 3641
 is_deeply($model->list->all, [{$key1 => 'a', $key3 => undef}], 'include all model');
3642
-$dbi->insert(table => $table1, param => {$key1 => 1});
3642
+$dbi->insert({$key1 => 1}, table => $table1);
3643 3643
 $model = $dbi->model($table1);
3644 3644
 is_deeply($model->list->all, [{$key1 => 1, $key2 => undef}], 'include all model');
3645 3645
 
... ...
@@ -3800,7 +3800,7 @@ $dbi->type_rule(
3800 3800
 );
3801 3801
 $result = $dbi->execute(
3802 3802
     "select * from $table1 where $key1 = :$key1 and $key2 = :$table1.$key2",
3803
-    param => {$key1 => '2010-01-03', "$table1.$key2" => '2010-01-01 01:01:02'}
3803
+    {$key1 => '2010-01-03', "$table1.$key2" => '2010-01-01 01:01:02'}
3804 3804
 );
3805 3805
 $row = $result->one;
3806 3806
 like($row->{$key1}, qr/^2010-01-03/);
... ...
@@ -3822,7 +3822,7 @@ $dbi->type_rule(
3822 3822
 );
3823 3823
 $result = $dbi->execute(
3824 3824
     "select * from $table1 where $key1 = :$key1 and $key2 = :$table1.$key2",
3825
-    param => {$key1 => '2010-01-02', "$table1.$key2" => '2010-01-01 01:01:02'},
3825
+    {$key1 => '2010-01-02', "$table1.$key2" => '2010-01-01 01:01:02'},
3826 3826
     table => $table1
3827 3827
 );
3828 3828
 $row = $result->one;
... ...
@@ -4200,10 +4200,10 @@ $dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
4200 4200
 $dbi->insert({$key1 => 3, $key2 => 4}, table => $table1);
4201 4201
 eval { $dbi->execute("drop table $table2") };
4202 4202
 $dbi->execute($create_table2);
4203
-$dbi->insert(table => $table2, param => {$key1 => 1, $key3 => 5});
4203
+$dbi->insert({$key1 => 1, $key3 => 5}, table => $table2);
4204 4204
 eval { $dbi->execute("drop table $table3") };
4205 4205
 $dbi->execute("create table $table3 ($key3 int, $key4 int)");
4206
-$dbi->insert(table => $table3, param => {$key3 => 5, $key4 => 4});
4206
+$dbi->insert({$key3 => 5, $key4 => 4}, table => $table3);
4207 4207
 $rows = $dbi->select(
4208 4208
     table => $table1,
4209 4209
     column => "$table1.$key1 as ${table1}_$key1, $table2.$key1 as ${table2}_$key1, $key2, $key3",
... ...
@@ -4219,10 +4219,10 @@ $dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
4219 4219
 $dbi->insert({$key1 => 3, $key2 => 4}, table => $table1);
4220 4220
 eval { $dbi->execute("drop table $table2") };
4221 4221
 $dbi->execute($create_table2);
4222
-$dbi->insert(table => $table2, param => {$key1 => 1, $key3 => 5});
4222
+$dbi->insert({$key1 => 1, $key3 => 5}, table => $table2);
4223 4223
 eval { $dbi->execute("drop table $table3") };
4224 4224
 $dbi->execute("create table $table3 ($key3 int, $key4 int)");
4225
-$dbi->insert(table => $table3, param => {$key3 => 5, $key4 => 4});
4225
+$dbi->insert({$key3 => 5, $key4 => 4}, table => $table3);
4226 4226
 $rows = $dbi->select(
4227 4227
     table => $table1,
4228 4228
     column => "$table1.$key1 as ${table1}_$key1, $table2.$key1 as ${table2}_$key1, $key2, $key3",
... ...
@@ -4273,7 +4273,7 @@ $dbi->execute($create_table1);
4273 4273
 $dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
4274 4274
 eval { $dbi->execute("drop table $table2") };
4275 4275
 $dbi->execute($create_table2);
4276
-$dbi->insert(table => $table2, param => {$key1 => 1, $key3 => 5});
4276
+$dbi->insert({$key1 => 1, $key3 => 5}, table => $table2);
4277 4277
 $rows = $dbi->select(
4278 4278
     table => $table1,
4279 4279
     column => "${q}$table1$p.${q}$key1$p as ${q}${table1}_$key1$p, ${q}$table2$p.${q}$key1$p as ${q}${table2}_$key1$p, ${q}$key2$p, ${q}$key3$p",
... ...
@@ -4311,8 +4311,8 @@ eval { $dbi->execute("drop table $table2") };
4311 4311
 $dbi->execute($create_table1);
4312 4312
 $dbi->execute($create_table2);
4313 4313
 $dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
4314
-$dbi->insert(table => $table2, param => {$key1 => 1, $key3 => 4});
4315
-$dbi->insert(table => $table2, param => {$key1 => 1, $key3 => 5});
4314
+$dbi->insert({$key1 => 1, $key3 => 4}, table => $table2);
4315
+$dbi->insert({$key1 => 1, $key3 => 5}, table => $table2);
4316 4316
 $result = $dbi->select(
4317 4317
     table => $table1,
4318 4318
     join => [
... ...
@@ -4343,8 +4343,8 @@ eval { $dbi->execute("drop table $table2") };
4343 4343
 $dbi->execute($create_table1);
4344 4344
 $dbi->execute($create_table2);
4345 4345
 $dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
4346
-$dbi->insert(table => $table2, param => {$key1 => 1, $key3 => 4});
4347
-$dbi->insert(table => $table2, param => {$key1 => 1, $key3 => 5});
4346
+$dbi->insert({$key1 => 1, $key3 => 4}, table => $table2);
4347
+$dbi->insert({$key1 => 1, $key3 => 5}, table => $table2);
4348 4348
 $result = $dbi->select(
4349 4349
     table => $table1,
4350 4350
     column => [{$table2 => [$key3]}],
... ...
@@ -4363,8 +4363,8 @@ eval { $dbi->execute("drop table $table2") };
4363 4363
 $dbi->execute($create_table1);
4364 4364
 $dbi->execute($create_table2);
4365 4365
 $dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
4366
-$dbi->insert(table => $table2, param => {$key1 => 1, $key3 => 4});
4367
-$dbi->insert(table => $table2, param => {$key1 => 1, $key3 => 1});
4366
+$dbi->insert({$key1 => 1, $key3 => 4}, table => $table2);
4367
+$dbi->insert({$key1 => 1, $key3 => 1}, table => $table2);
4368 4368
 $result = $dbi->select(
4369 4369
     table => $table1,
4370 4370
     column => [{$table2 => [$key3]}],
... ...
@@ -4380,8 +4380,8 @@ eval { $dbi->execute("drop table $table2") };
4380 4380
 $dbi->execute($create_table1);
4381 4381
 $dbi->execute($create_table2);
4382 4382
 $dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
4383
-$dbi->insert(table => $table2, param => {$key1 => 1, $key3 => 4});
4384
-$dbi->insert(table => $table2, param => {$key1 => 1, $key3 => 1});
4383
+$dbi->insert({$key1 => 1, $key3 => 4}, table => $table2);
4384
+$dbi->insert({$key1 => 1, $key3 => 1}, table => $table2);
4385 4385
 $result = $dbi->select(
4386 4386
     table => $table1,
4387 4387
     column => [{$table2 => [$key3]}],
... ...
@@ -4400,7 +4400,7 @@ $dbi = DBIx::Custom->connect;
4400 4400
 eval { $dbi->execute("drop table $table1") };
4401 4401
 $dbi->execute($create_table1);
4402 4402
 $dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
4403
-$dbi->insert(table => $table1, param => {$key1 => 1, $key2 => 3});
4403
+$dbi->insert({$key1 => 1, $key2 => 3}, table => $table1);
4404 4404
 is($dbi->count(table => $table1), 2);
4405 4405
 is($dbi->count(table => $table1, where => {$key2 => 2}), 1);
4406 4406
 $model = $dbi->create_model(table => $table1);