| ... | ... |
@@ -4,7 +4,7 @@ use warnings; |
| 4 | 4 |
use utf8; |
| 5 | 5 |
|
| 6 | 6 |
use FindBin; |
| 7 |
-use DBIx::Custom::Next; |
|
| 7 |
+use DBIx::Custom; |
|
| 8 | 8 |
|
| 9 | 9 |
my $dbi; |
| 10 | 10 |
my $dsn; |
| ... | ... |
@@ -14,7 +14,7 @@ my $database = "$FindBin::Bin/access.mdb"; |
| 14 | 14 |
$dsn = "dbi:ODBC:driver=Microsoft Access Driver (*.mdb);dbq=$database"; |
| 15 | 15 |
|
| 16 | 16 |
plan skip_all => 'Microsoft access(ODBC, *.mdb) private test' unless -f "$FindBin::Bin/run/access.run" |
| 17 |
- && eval { $dbi = DBIx::Custom::Next->connect(dsn => $dsn); 1 };
|
|
| 17 |
+ && eval { $dbi = DBIx::Custom->connect(dsn => $dsn); 1 };
|
|
| 18 | 18 |
plan 'no_plan'; |
| 19 | 19 |
|
| 20 | 20 |
my $model; |
| ... | ... |
@@ -4,7 +4,7 @@ use warnings; |
| 4 | 4 |
use utf8; |
| 5 | 5 |
|
| 6 | 6 |
use FindBin; |
| 7 |
-use DBIx::Custom::Next; |
|
| 7 |
+use DBIx::Custom; |
|
| 8 | 8 |
|
| 9 | 9 |
my $dbi; |
| 10 | 10 |
my $dsn; |
| ... | ... |
@@ -14,7 +14,7 @@ $dsn = "dbi:ODBC:Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=$database
|
| 14 | 14 |
|
| 15 | 15 |
plan skip_all => 'Microsoft access(ODBC, *.accdb(2007)) private test' |
| 16 | 16 |
unless -f "$FindBin::Bin/run/access2007-accdb.run" |
| 17 |
- && eval { $dbi = DBIx::Custom::Next->connect(dsn => $dsn); 1 };
|
|
| 17 |
+ && eval { $dbi = DBIx::Custom->connect(dsn => $dsn); 1 };
|
|
| 18 | 18 |
plan 'no_plan'; |
| 19 | 19 |
|
| 20 | 20 |
my $model; |
| ... | ... |
@@ -4,7 +4,7 @@ use warnings; |
| 4 | 4 |
use utf8; |
| 5 | 5 |
|
| 6 | 6 |
use FindBin; |
| 7 |
-use DBIx::Custom::Next; |
|
| 7 |
+use DBIx::Custom; |
|
| 8 | 8 |
|
| 9 | 9 |
my $dbi; |
| 10 | 10 |
my $dsn; |
| ... | ... |
@@ -14,7 +14,7 @@ $dsn = "dbi:ODBC:Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=$database
|
| 14 | 14 |
|
| 15 | 15 |
plan skip_all => 'Microsoft access(ODBC, *.accdb(2010)) private test' |
| 16 | 16 |
unless -f "$FindBin::Bin/run/access2010-accdb.run" |
| 17 |
- && eval { $dbi = DBIx::Custom::Next->connect(dsn => $dsn); 1 };
|
|
| 17 |
+ && eval { $dbi = DBIx::Custom->connect(dsn => $dsn); 1 };
|
|
| 18 | 18 |
plan 'no_plan'; |
| 19 | 19 |
|
| 20 | 20 |
my $model; |
| ... | ... |
@@ -9,9 +9,9 @@ $ENV{DBIX_CUSTOM_SKIP_MESSAGE} = 'mysql private test';
|
| 9 | 9 |
|
| 10 | 10 |
|
| 11 | 11 |
|
| 12 |
-use DBIx::Custom::Next; |
|
| 12 |
+use DBIx::Custom; |
|
| 13 | 13 |
{
|
| 14 |
- package DBIx::Custom::Next; |
|
| 14 |
+ package DBIx::Custom; |
|
| 15 | 15 |
no warnings 'redefine'; |
| 16 | 16 |
|
| 17 | 17 |
my $table1 = 'table1'; |
| ... | ... |
@@ -7,9 +7,9 @@ $ENV{DBIX_CUSTOM_TEST_RUN} = 1
|
| 7 | 7 |
if -f "$FindBin::Bin/run/common-oracle.run"; |
| 8 | 8 |
$ENV{DBIX_CUSTOM_SKIP_MESSAGE} = 'oracle private test';
|
| 9 | 9 |
|
| 10 |
-use DBIx::Custom::Next; |
|
| 10 |
+use DBIx::Custom; |
|
| 11 | 11 |
{
|
| 12 |
- package DBIx::Custom::Next; |
|
| 12 |
+ package DBIx::Custom; |
|
| 13 | 13 |
no warnings 'redefine'; |
| 14 | 14 |
|
| 15 | 15 |
has option => sub {
|
| ... | ... |
@@ -7,9 +7,9 @@ $ENV{DBIX_CUSTOM_TEST_RUN} = 1
|
| 7 | 7 |
if -f "$FindBin::Bin/run/common-postgresql.run"; |
| 8 | 8 |
$ENV{DBIX_CUSTOM_SKIP_MESSAGE} = 'postgresql private test';
|
| 9 | 9 |
|
| 10 |
-use DBIx::Custom::Next; |
|
| 10 |
+use DBIx::Custom; |
|
| 11 | 11 |
{
|
| 12 |
- package DBIx::Custom::Next; |
|
| 12 |
+ package DBIx::Custom; |
|
| 13 | 13 |
no warnings 'redefine'; |
| 14 | 14 |
|
| 15 | 15 |
my $table1 = 'table1'; |
| ... | ... |
@@ -5,9 +5,9 @@ use FindBin; |
| 5 | 5 |
use lib "$FindBin::Bin/common"; |
| 6 | 6 |
$ENV{DBIX_CUSTOM_TEST_RUN} = 1;
|
| 7 | 7 |
|
| 8 |
-use DBIx::Custom::Next; |
|
| 8 |
+use DBIx::Custom; |
|
| 9 | 9 |
{
|
| 10 |
- package DBIx::Custom::Next; |
|
| 10 |
+ package DBIx::Custom; |
|
| 11 | 11 |
no warnings 'redefine'; |
| 12 | 12 |
|
| 13 | 13 |
my $table1 = 'table1'; |
| ... | ... |
@@ -5,9 +5,9 @@ use FindBin; |
| 5 | 5 |
use lib "$FindBin::Bin/common"; |
| 6 | 6 |
$ENV{DBIX_CUSTOM_TEST_RUN} = 1;
|
| 7 | 7 |
|
| 8 |
-use DBIx::Custom::Next; |
|
| 8 |
+use DBIx::Custom; |
|
| 9 | 9 |
{
|
| 10 |
- package DBIx::Custom::Next; |
|
| 10 |
+ package DBIx::Custom; |
|
| 11 | 11 |
no warnings 'redefine'; |
| 12 | 12 |
|
| 13 | 13 |
my $table1 = 'table1'; |
| ... | ... |
@@ -7,9 +7,9 @@ $ENV{DBIX_CUSTOM_TEST_RUN} = 1
|
| 7 | 7 |
if -f "$FindBin::Bin/run/common-sqlserver.run"; |
| 8 | 8 |
$ENV{DBIX_CUSTOM_SKIP_MESSAGE} = 'sqlserver private test';
|
| 9 | 9 |
|
| 10 |
-use DBIx::Custom::Next; |
|
| 10 |
+use DBIx::Custom; |
|
| 11 | 11 |
{
|
| 12 |
- package DBIx::Custom::Next; |
|
| 12 |
+ package DBIx::Custom; |
|
| 13 | 13 |
no warnings 'redefine'; |
| 14 | 14 |
|
| 15 | 15 |
my $table1 = 'table1'; |
| ... | ... |
@@ -9,7 +9,7 @@ my $dbi; |
| 9 | 9 |
|
| 10 | 10 |
plan skip_all => $ENV{DBIX_CUSTOM_SKIP_MESSAGE} || 'common.t is always skipped'
|
| 11 | 11 |
unless $ENV{DBIX_CUSTOM_TEST_RUN}
|
| 12 |
- && eval { $dbi = DBIx::Custom::Next->connect; 1 };
|
|
| 12 |
+ && eval { $dbi = DBIx::Custom->connect; 1 };
|
|
| 13 | 13 |
|
| 14 | 14 |
plan 'no_plan'; |
| 15 | 15 |
|
| ... | ... |
@@ -88,7 +88,7 @@ require MyDBI1; |
| 88 | 88 |
use strict; |
| 89 | 89 |
use warnings; |
| 90 | 90 |
|
| 91 |
- use base 'DBIx::Custom::Next'; |
|
| 91 |
+ use base 'DBIx::Custom'; |
|
| 92 | 92 |
|
| 93 | 93 |
sub connect {
|
| 94 | 94 |
my $self = shift->SUPER::connect(@_); |
| ... | ... |
@@ -106,7 +106,7 @@ require MyDBI1; |
| 106 | 106 |
use strict; |
| 107 | 107 |
use warnings; |
| 108 | 108 |
|
| 109 |
- use base 'DBIx::Custom::Next::Model'; |
|
| 109 |
+ use base 'DBIx::Custom::Model'; |
|
| 110 | 110 |
|
| 111 | 111 |
package MyModel2::table1; |
| 112 | 112 |
|
| ... | ... |
@@ -174,7 +174,7 @@ require MyDBI1; |
| 174 | 174 |
use strict; |
| 175 | 175 |
use warnings; |
| 176 | 176 |
|
| 177 |
- use base 'DBIx::Custom::Next'; |
|
| 177 |
+ use base 'DBIx::Custom'; |
|
| 178 | 178 |
|
| 179 | 179 |
sub connect {
|
| 180 | 180 |
my $self = shift->SUPER::connect(@_); |
| ... | ... |
@@ -185,7 +185,7 @@ require MyDBI1; |
| 185 | 185 |
{
|
| 186 | 186 |
package MyDBI6; |
| 187 | 187 |
|
| 188 |
- use base 'DBIx::Custom::Next'; |
|
| 188 |
+ use base 'DBIx::Custom'; |
|
| 189 | 189 |
|
| 190 | 190 |
sub connect {
|
| 191 | 191 |
my $self = shift->SUPER::connect(@_); |
| ... | ... |
@@ -198,7 +198,7 @@ require MyDBI1; |
| 198 | 198 |
{
|
| 199 | 199 |
package MyDBI7; |
| 200 | 200 |
|
| 201 |
- use base 'DBIx::Custom::Next'; |
|
| 201 |
+ use base 'DBIx::Custom'; |
|
| 202 | 202 |
|
| 203 | 203 |
sub connect {
|
| 204 | 204 |
my $self = shift->SUPER::connect(@_); |
| ... | ... |
@@ -212,7 +212,7 @@ require MyDBI1; |
| 212 | 212 |
{
|
| 213 | 213 |
package MyDBI8; |
| 214 | 214 |
|
| 215 |
- use base 'DBIx::Custom::Next'; |
|
| 215 |
+ use base 'DBIx::Custom'; |
|
| 216 | 216 |
|
| 217 | 217 |
sub connect {
|
| 218 | 218 |
my $self = shift->SUPER::connect(@_); |
| ... | ... |
@@ -226,7 +226,7 @@ require MyDBI1; |
| 226 | 226 |
{
|
| 227 | 227 |
package MyDBI9; |
| 228 | 228 |
|
| 229 |
- use base 'DBIx::Custom::Next'; |
|
| 229 |
+ use base 'DBIx::Custom'; |
|
| 230 | 230 |
|
| 231 | 231 |
sub connect {
|
| 232 | 232 |
my $self = shift->SUPER::connect(@_); |
| ... | ... |
@@ -248,7 +248,7 @@ $rows = $dbi->select(table => $table1)->all; |
| 248 | 248 |
is_deeply($rows, [{$key1 => 1, $key2 => 2}, {$key1 => 1, $key2 => 2}]);
|
| 249 | 249 |
|
| 250 | 250 |
# Get user table info |
| 251 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 251 |
+$dbi = DBIx::Custom->connect; |
|
| 252 | 252 |
eval { $dbi->execute("drop table $table1") };
|
| 253 | 253 |
eval { $dbi->execute("drop table $table2") };
|
| 254 | 254 |
eval { $dbi->execute("drop table $table3") };
|
| ... | ... |
@@ -258,14 +258,14 @@ $dbi->execute($create_table3); |
| 258 | 258 |
$user_table_info = $dbi->get_table_info(exclude => $dbi->exclude_table); |
| 259 | 259 |
|
| 260 | 260 |
# Create table |
| 261 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 261 |
+$dbi = DBIx::Custom->connect; |
|
| 262 | 262 |
eval { $dbi->execute("drop table $table1") };
|
| 263 | 263 |
$dbi->execute($create_table1); |
| 264 | 264 |
$model = $dbi->create_model(table => $table1); |
| 265 | 265 |
$model->insert({$key1 => 1, $key2 => 2});
|
| 266 | 266 |
is_deeply($model->select->all, [{$key1 => 1, $key2 => 2}]);
|
| 267 | 267 |
|
| 268 |
-test 'DBIx::Custom::Next::Result test'; |
|
| 268 |
+test 'DBIx::Custom::Result test'; |
|
| 269 | 269 |
$dbi->delete_all(table => $table1); |
| 270 | 270 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| 271 | 271 |
$dbi->insert({$key1 => 3, $key2 => 4}, table => $table1);
|
| ... | ... |
@@ -372,7 +372,7 @@ $rows = $result->all; |
| 372 | 372 |
is_deeply($rows, [{$key1 => 'a:b c:d', $key2 => 2}]);
|
| 373 | 373 |
|
| 374 | 374 |
test 'Error case'; |
| 375 |
-eval {DBIx::Custom::Next->connect(dsn => 'dbi:SQLit')};
|
|
| 375 |
+eval {DBIx::Custom->connect(dsn => 'dbi:SQLit')};
|
|
| 376 | 376 |
ok($@, "connect error"); |
| 377 | 377 |
|
| 378 | 378 |
test 'insert'; |
| ... | ... |
@@ -871,7 +871,7 @@ eval{$dbi->delete(table => $table1, where => {';' => 1})};
|
| 871 | 871 |
like($@, qr/safety/); |
| 872 | 872 |
|
| 873 | 873 |
$dbi = undef; |
| 874 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 874 |
+$dbi = DBIx::Custom->connect; |
|
| 875 | 875 |
eval { $dbi->execute("drop table ${q}table$p") };
|
| 876 | 876 |
$dbi->execute($create_table_reserved); |
| 877 | 877 |
$dbi->insert({select => 1}, table => 'table');
|
| ... | ... |
@@ -932,7 +932,7 @@ $rows = $dbi->select( |
| 932 | 932 |
)->all; |
| 933 | 933 |
is_deeply($rows, [{"${table1}_$key1" => 1, "${table2}_$key1" => 1, $key2 => 2, $key3 => 5}], "no exists where");
|
| 934 | 934 |
|
| 935 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 935 |
+$dbi = DBIx::Custom->connect; |
|
| 936 | 936 |
eval { $dbi->execute("drop table ${q}table$p") };
|
| 937 | 937 |
$dbi->execute($create_table_reserved); |
| 938 | 938 |
$dbi->insert({select => 1, update => 2}, table => 'table');
|
| ... | ... |
@@ -962,7 +962,7 @@ $row = $result->fetch_first; |
| 962 | 962 |
is_deeply($row, [3, 3, 2], "default_fetch_filter and filter"); |
| 963 | 963 |
|
| 964 | 964 |
test 'filters'; |
| 965 |
-$dbi = DBIx::Custom::Next->new; |
|
| 965 |
+$dbi = DBIx::Custom->new; |
|
| 966 | 966 |
|
| 967 | 967 |
is($dbi->filters->{decode_utf8}->(encode_utf8('あ')),
|
| 968 | 968 |
'あ', "decode_utf8"); |
| ... | ... |
@@ -971,7 +971,7 @@ is($dbi->filters->{encode_utf8}->('あ'),
|
| 971 | 971 |
encode_utf8('あ'), "encode_utf8");
|
| 972 | 972 |
|
| 973 | 973 |
test 'transaction1'; |
| 974 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 974 |
+$dbi = DBIx::Custom->connect; |
|
| 975 | 975 |
eval { $dbi->execute("drop table $table1") };
|
| 976 | 976 |
$dbi->execute($create_table1); |
| 977 | 977 |
$dbi->begin_work; |
| ... | ... |
@@ -984,7 +984,7 @@ $result = $dbi->select(table => $table1); |
| 984 | 984 |
ok(! $result->fetch_first, "rollback"); |
| 985 | 985 |
|
| 986 | 986 |
|
| 987 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 987 |
+$dbi = DBIx::Custom->connect; |
|
| 988 | 988 |
eval { $dbi->execute("drop table $table1") };
|
| 989 | 989 |
$dbi->execute($create_table1); |
| 990 | 990 |
$dbi->begin_work; |
| ... | ... |
@@ -1018,7 +1018,7 @@ eval{$dbi->execute($query, {$key1 => {a => 1}})};
|
| 1018 | 1018 |
ok($@, "execute fail"); |
| 1019 | 1019 |
|
| 1020 | 1020 |
test 'transaction2'; |
| 1021 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1021 |
+$dbi = DBIx::Custom->connect; |
|
| 1022 | 1022 |
eval { $dbi->execute("drop table $table1") };
|
| 1023 | 1023 |
$dbi->execute($create_table1); |
| 1024 | 1024 |
|
| ... | ... |
@@ -1096,7 +1096,7 @@ eval {$dbi->XXXXXX};
|
| 1096 | 1096 |
ok($@, "not exists"); |
| 1097 | 1097 |
|
| 1098 | 1098 |
test 'out filter'; |
| 1099 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1099 |
+$dbi = DBIx::Custom->connect; |
|
| 1100 | 1100 |
eval { $dbi->execute("drop table $table1") };
|
| 1101 | 1101 |
$dbi->execute($create_table1); |
| 1102 | 1102 |
$dbi->register_filter(twice => sub { $_[0] * 2 });
|
| ... | ... |
@@ -1109,7 +1109,7 @@ $result = $dbi->select(table => $table1); |
| 1109 | 1109 |
$row = $result->one; |
| 1110 | 1110 |
is_deeply($row, {$key1 => 1, $key2 => 2}, "insert");
|
| 1111 | 1111 |
|
| 1112 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1112 |
+$dbi = DBIx::Custom->connect; |
|
| 1113 | 1113 |
eval { $dbi->execute("drop table $table1") };
|
| 1114 | 1114 |
$dbi->execute($create_table1); |
| 1115 | 1115 |
$dbi->register_filter(twice => sub { $_[0] * 2 });
|
| ... | ... |
@@ -1119,7 +1119,7 @@ $result = $dbi->execute("select * from $table1");
|
| 1119 | 1119 |
$row = $result->one; |
| 1120 | 1120 |
is_deeply($row, {$key1 => 1, $key2 => 2}, "insert");
|
| 1121 | 1121 |
|
| 1122 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1122 |
+$dbi = DBIx::Custom->connect; |
|
| 1123 | 1123 |
eval { $dbi->execute("drop table $table1") };
|
| 1124 | 1124 |
$dbi->execute($create_table1); |
| 1125 | 1125 |
$dbi->register_filter(twice => sub { $_[0] * 2 });
|
| ... | ... |
@@ -1129,7 +1129,7 @@ $result = $dbi->execute("select * from $table1");
|
| 1129 | 1129 |
$row = $result->one; |
| 1130 | 1130 |
is_deeply($row, {$key1 => 2, $key2 => 2}, "update");
|
| 1131 | 1131 |
|
| 1132 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1132 |
+$dbi = DBIx::Custom->connect; |
|
| 1133 | 1133 |
eval { $dbi->execute("drop table $table1") };
|
| 1134 | 1134 |
$dbi->execute($create_table1); |
| 1135 | 1135 |
$dbi->register_filter(twice => sub { $_[0] * 2 });
|
| ... | ... |
@@ -1139,7 +1139,7 @@ $result = $dbi->execute("select * from $table1");
|
| 1139 | 1139 |
$rows = $result->all; |
| 1140 | 1140 |
is_deeply($rows, [], "delete"); |
| 1141 | 1141 |
|
| 1142 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1142 |
+$dbi = DBIx::Custom->connect; |
|
| 1143 | 1143 |
eval { $dbi->execute("drop table $table1") };
|
| 1144 | 1144 |
$dbi->execute($create_table1); |
| 1145 | 1145 |
$dbi->register_filter(twice => sub { $_[0] * 2 });
|
| ... | ... |
@@ -1149,7 +1149,7 @@ $result->filter({$key2 => 'twice'});
|
| 1149 | 1149 |
$rows = $result->all; |
| 1150 | 1150 |
is_deeply($rows, [{$key1 => 2, $key2 => 4}], "select");
|
| 1151 | 1151 |
|
| 1152 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1152 |
+$dbi = DBIx::Custom->connect; |
|
| 1153 | 1153 |
eval { $dbi->execute("drop table $table1") };
|
| 1154 | 1154 |
$dbi->execute($create_table1); |
| 1155 | 1155 |
$dbi->register_filter(twice => sub { $_[0] * 2 });
|
| ... | ... |
@@ -1160,7 +1160,7 @@ $result = $dbi->execute("select * from $table1 where $key1 = :$key1 and $key2 =
|
| 1160 | 1160 |
$rows = $result->all; |
| 1161 | 1161 |
is_deeply($rows, [{$key1 => 2, $key2 => 2}], "execute");
|
| 1162 | 1162 |
|
| 1163 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1163 |
+$dbi = DBIx::Custom->connect; |
|
| 1164 | 1164 |
eval { $dbi->execute("drop table $table1") };
|
| 1165 | 1165 |
$dbi->execute($create_table1); |
| 1166 | 1166 |
$dbi->register_filter(twice => sub { $_[0] * 2 });
|
| ... | ... |
@@ -1170,7 +1170,7 @@ $result = $dbi->execute("select * from $table1 where $key1 = :$key1 and $key2 =
|
| 1170 | 1170 |
$rows = $result->all; |
| 1171 | 1171 |
is_deeply($rows, [{$key1 => 2, $key2 => 2}], "execute table tag");
|
| 1172 | 1172 |
|
| 1173 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1173 |
+$dbi = DBIx::Custom->connect; |
|
| 1174 | 1174 |
eval { $dbi->execute("drop table $table1") };
|
| 1175 | 1175 |
eval { $dbi->execute("drop table $table2") };
|
| 1176 | 1176 |
$dbi->execute($create_table1); |
| ... | ... |
@@ -1201,27 +1201,27 @@ $rows = $result->all; |
| 1201 | 1201 |
is_deeply($rows, [{$key2 => 4, $key3 => 6, "${table2}_$key3" => 6}], "select : join : omit");
|
| 1202 | 1202 |
|
| 1203 | 1203 |
test 'connect super'; |
| 1204 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1204 |
+$dbi = DBIx::Custom->connect; |
|
| 1205 | 1205 |
eval { $dbi->execute("drop table $table1") };
|
| 1206 | 1206 |
$dbi->execute($create_table1); |
| 1207 | 1207 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| 1208 | 1208 |
is($dbi->select(table => $table1)->one->{$key1}, 1);
|
| 1209 | 1209 |
|
| 1210 |
-$dbi = DBIx::Custom::Next->new; |
|
| 1210 |
+$dbi = DBIx::Custom->new; |
|
| 1211 | 1211 |
$dbi->connect; |
| 1212 | 1212 |
eval { $dbi->execute("drop table $table1") };
|
| 1213 | 1213 |
$dbi->execute($create_table1); |
| 1214 | 1214 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| 1215 | 1215 |
is($dbi->select(table => $table1)->one->{$key1}, 1);
|
| 1216 | 1216 |
|
| 1217 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1217 |
+$dbi = DBIx::Custom->connect; |
|
| 1218 | 1218 |
eval { $dbi->execute("drop table $table1") };
|
| 1219 | 1219 |
$dbi->execute($create_table1); |
| 1220 | 1220 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| 1221 | 1221 |
is($dbi->select(table => $table1)->one->{$key1}, 1);
|
| 1222 | 1222 |
|
| 1223 | 1223 |
test 'filter'; |
| 1224 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1224 |
+$dbi = DBIx::Custom->connect; |
|
| 1225 | 1225 |
eval { $dbi->execute("drop table $table1") };
|
| 1226 | 1226 |
$dbi->execute($create_table1); |
| 1227 | 1227 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -1230,7 +1230,7 @@ $result->filter($key1 => sub { $_[0] * 2 }, $key2 => sub { $_[0] * 4 });
|
| 1230 | 1230 |
$row = $result->fetch_first; |
| 1231 | 1231 |
is_deeply($row, [2, 8]); |
| 1232 | 1232 |
|
| 1233 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1233 |
+$dbi = DBIx::Custom->connect; |
|
| 1234 | 1234 |
eval { $dbi->execute("drop table $table1") };
|
| 1235 | 1235 |
$dbi->execute($create_table1); |
| 1236 | 1236 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -1239,7 +1239,7 @@ $result->filter($key1 => sub { $_[0] * 2 }, $key2 => sub { $_[0] * 4 });
|
| 1239 | 1239 |
$row = $result->fetch_first; |
| 1240 | 1240 |
is_deeply($row, [2, 2, 8]); |
| 1241 | 1241 |
|
| 1242 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1242 |
+$dbi = DBIx::Custom->connect; |
|
| 1243 | 1243 |
eval { $dbi->execute("drop table $table1") };
|
| 1244 | 1244 |
$dbi->execute($create_table1); |
| 1245 | 1245 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -1248,7 +1248,7 @@ $result->filter([$key1, $key2] => sub { $_[0] * 2 });
|
| 1248 | 1248 |
$row = $result->fetch_first; |
| 1249 | 1249 |
is_deeply($row, [2, 4]); |
| 1250 | 1250 |
|
| 1251 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1251 |
+$dbi = DBIx::Custom->connect; |
|
| 1252 | 1252 |
eval { $dbi->execute("drop table $table1") };
|
| 1253 | 1253 |
$dbi->execute($create_table1); |
| 1254 | 1254 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -1270,7 +1270,7 @@ $row = $result->one; |
| 1270 | 1270 |
is_deeply($row, {$key1 => 2, $key2 => 8}, 'apply_filter');
|
| 1271 | 1271 |
|
| 1272 | 1272 |
test 'empty where select'; |
| 1273 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1273 |
+$dbi = DBIx::Custom->connect; |
|
| 1274 | 1274 |
eval { $dbi->execute("drop table $table1") };
|
| 1275 | 1275 |
$dbi->execute($create_table1); |
| 1276 | 1276 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -1279,20 +1279,20 @@ $row = $result->one; |
| 1279 | 1279 |
is_deeply($row, {$key1 => 1, $key2 => 2});
|
| 1280 | 1280 |
|
| 1281 | 1281 |
test 'select query option'; |
| 1282 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1282 |
+$dbi = DBIx::Custom->connect; |
|
| 1283 | 1283 |
eval { $dbi->execute("drop table $table1") };
|
| 1284 | 1284 |
$dbi->execute($create_table1); |
| 1285 | 1285 |
$query = $dbi->insert({$key1 => 1, $key2 => 2}, table => $table1, query => 1);
|
| 1286 |
-is(ref $query, 'HASH'); |
|
| 1286 |
+ok(ref $query); |
|
| 1287 | 1287 |
$query = $dbi->update({$key2 => 2}, table => $table1, where => {$key1 => 1}, query => 1);
|
| 1288 |
-is(ref $query, 'HASH'); |
|
| 1288 |
+ok(ref $query); |
|
| 1289 | 1289 |
$query = $dbi->delete(table => $table1, where => {$key1 => 1}, query => 1);
|
| 1290 |
-is(ref $query, 'HASH'); |
|
| 1290 |
+ok(ref $query); |
|
| 1291 | 1291 |
$query = $dbi->select(table => $table1, where => {$key1 => 1, $key2 => 2}, query => 1);
|
| 1292 |
-is(ref $query, 'HASH'); |
|
| 1292 |
+ok(ref $query); |
|
| 1293 | 1293 |
|
| 1294 | 1294 |
test 'where'; |
| 1295 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1295 |
+$dbi = DBIx::Custom->connect; |
|
| 1296 | 1296 |
eval { $dbi->execute("drop table $table1") };
|
| 1297 | 1297 |
$dbi->execute($create_table1); |
| 1298 | 1298 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -1585,7 +1585,7 @@ $row = $result->all; |
| 1585 | 1585 |
is_deeply($row, [{$key1 => 1, $key2 => 2}]);
|
| 1586 | 1586 |
|
| 1587 | 1587 |
|
| 1588 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1588 |
+$dbi = DBIx::Custom->connect; |
|
| 1589 | 1589 |
eval { $dbi->execute("drop table $table1") };
|
| 1590 | 1590 |
$dbi->execute($create_table1); |
| 1591 | 1591 |
$dbi->insert({$key1 => 1, $key2 => '00:00:00'}, table => $table1);
|
| ... | ... |
@@ -1602,11 +1602,11 @@ $row = $result->all; |
| 1602 | 1602 |
is_deeply($row, [{$key1 => 1, $key2 => '00:00:00'}]);
|
| 1603 | 1603 |
|
| 1604 | 1604 |
test 'table not specify exception'; |
| 1605 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1605 |
+$dbi = DBIx::Custom->connect; |
|
| 1606 | 1606 |
eval {$dbi->select};
|
| 1607 | 1607 |
like($@, qr/table/); |
| 1608 | 1608 |
|
| 1609 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1609 |
+$dbi = DBIx::Custom->connect; |
|
| 1610 | 1610 |
eval { $dbi->execute("drop table $table1") };
|
| 1611 | 1611 |
$dbi->execute($create_table1); |
| 1612 | 1612 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -1614,7 +1614,7 @@ $dbi->insert({$key1 => 3, $key2 => 4}, table => $table1);
|
| 1614 | 1614 |
$rows = $dbi->select(table => $table1, where => {$key2 => 2})->all;
|
| 1615 | 1615 |
is_deeply($rows, [{$key1 => 1, $key2 => 2}]);
|
| 1616 | 1616 |
|
| 1617 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1617 |
+$dbi = DBIx::Custom->connect; |
|
| 1618 | 1618 |
eval { $dbi->execute("drop table $table1") };
|
| 1619 | 1619 |
$dbi->execute($create_table1); |
| 1620 | 1620 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -1625,10 +1625,10 @@ is_deeply($rows, [{$key1 => 1, $key2 => 2}]);
|
| 1625 | 1625 |
$dbi->helper({one => sub { 1 }});
|
| 1626 | 1626 |
is($dbi->one, 1); |
| 1627 | 1627 |
|
| 1628 |
-eval{DBIx::Custom::Next->connect(dsn => undef)};
|
|
| 1628 |
+eval{DBIx::Custom->connect(dsn => undef)};
|
|
| 1629 | 1629 |
like($@, qr/_connect/); |
| 1630 | 1630 |
|
| 1631 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1631 |
+$dbi = DBIx::Custom->connect; |
|
| 1632 | 1632 |
eval { $dbi->execute("drop table $table1") };
|
| 1633 | 1633 |
$dbi->execute($create_table1); |
| 1634 | 1634 |
$dbi->register_filter(twice => sub { $_[0] * 2 });
|
| ... | ... |
@@ -1640,7 +1640,7 @@ eval {$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1,
|
| 1640 | 1640 |
filter => {$key1 => 'no'}) };
|
| 1641 | 1641 |
like($@, qr//); |
| 1642 | 1642 |
|
| 1643 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1643 |
+$dbi = DBIx::Custom->connect; |
|
| 1644 | 1644 |
eval { $dbi->execute("drop table $table1") };
|
| 1645 | 1645 |
$dbi->execute($create_table1); |
| 1646 | 1646 |
$dbi->register_filter(one => sub { 1 });
|
| ... | ... |
@@ -1649,21 +1649,21 @@ eval {$result->filter($key1 => 'no')};
|
| 1649 | 1649 |
like($@, qr/not registered/); |
| 1650 | 1650 |
|
| 1651 | 1651 |
test 'option'; |
| 1652 |
-$dbi = DBIx::Custom::Next->connect(option => {PrintError => 1});
|
|
| 1652 |
+$dbi = DBIx::Custom->connect(option => {PrintError => 1});
|
|
| 1653 | 1653 |
ok($dbi->dbh->{PrintError});
|
| 1654 |
-$dbi = DBIx::Custom::Next->connect(option => {PrintError => 1});
|
|
| 1654 |
+$dbi = DBIx::Custom->connect(option => {PrintError => 1});
|
|
| 1655 | 1655 |
ok($dbi->dbh->{PrintError});
|
| 1656 |
-$dbi = DBIx::Custom::Next->connect(option => {PrintError => 1});
|
|
| 1656 |
+$dbi = DBIx::Custom->connect(option => {PrintError => 1});
|
|
| 1657 | 1657 |
ok($dbi->dbh->{PrintError});
|
| 1658 | 1658 |
|
| 1659 |
-test 'DBIx::Custom::Next::Result stash()'; |
|
| 1660 |
-$result = DBIx::Custom::Next::Result->new; |
|
| 1659 |
+test 'DBIx::Custom::Result stash()'; |
|
| 1660 |
+$result = DBIx::Custom::Result->new; |
|
| 1661 | 1661 |
is_deeply($result->stash, {}, 'default');
|
| 1662 | 1662 |
$result->stash->{foo} = 1;
|
| 1663 | 1663 |
is($result->stash->{foo}, 1, 'get and set');
|
| 1664 | 1664 |
|
| 1665 | 1665 |
test 'delete'; |
| 1666 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1666 |
+$dbi = DBIx::Custom->connect; |
|
| 1667 | 1667 |
eval { $dbi->execute("drop table $table1") };
|
| 1668 | 1668 |
$dbi->execute($create_table1_2); |
| 1669 | 1669 |
$dbi->insert({$key1 => 1, $key2 => 2, $key3 => 3}, table => $table1);
|
| ... | ... |
@@ -1683,7 +1683,7 @@ $dbi->delete( |
| 1683 | 1683 |
is_deeply($dbi->select(table => $table1)->all, []); |
| 1684 | 1684 |
|
| 1685 | 1685 |
test 'insert'; |
| 1686 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1686 |
+$dbi = DBIx::Custom->connect; |
|
| 1687 | 1687 |
eval { $dbi->execute("drop table $table1") };
|
| 1688 | 1688 |
$dbi->execute($create_table1_2); |
| 1689 | 1689 |
$dbi->insert( |
| ... | ... |
@@ -1709,7 +1709,7 @@ is($dbi->select(table => $table1)->one->{$key1}, 1);
|
| 1709 | 1709 |
is($dbi->select(table => $table1)->one->{$key2}, 2);
|
| 1710 | 1710 |
is($dbi->select(table => $table1)->one->{$key3}, 3);
|
| 1711 | 1711 |
|
| 1712 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1712 |
+$dbi = DBIx::Custom->connect; |
|
| 1713 | 1713 |
eval { $dbi->execute("drop table $table1") };
|
| 1714 | 1714 |
$dbi->execute($create_table1_2); |
| 1715 | 1715 |
$dbi->insert( |
| ... | ... |
@@ -1723,7 +1723,7 @@ is($dbi->select(table => $table1)->one->{$key2}, 2);
|
| 1723 | 1723 |
is($dbi->select(table => $table1)->one->{$key3}, 3);
|
| 1724 | 1724 |
|
| 1725 | 1725 |
test 'update'; |
| 1726 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1726 |
+$dbi = DBIx::Custom->connect; |
|
| 1727 | 1727 |
eval { $dbi->execute("drop table $table1") };
|
| 1728 | 1728 |
$dbi->execute($create_table1_2); |
| 1729 | 1729 |
$dbi->insert({$key1 => 1, $key2 => 2, $key3 => 3}, table => $table1);
|
| ... | ... |
@@ -1749,7 +1749,7 @@ is($dbi->select(table => $table1)->one->{$key1}, 1);
|
| 1749 | 1749 |
is($dbi->select(table => $table1)->one->{$key2}, 2);
|
| 1750 | 1750 |
is($dbi->select(table => $table1)->one->{$key3}, 4);
|
| 1751 | 1751 |
|
| 1752 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1752 |
+$dbi = DBIx::Custom->connect; |
|
| 1753 | 1753 |
eval { $dbi->execute("drop table $table1") };
|
| 1754 | 1754 |
$dbi->execute($create_table1_2); |
| 1755 | 1755 |
$dbi->insert({$key1 => 1, $key2 => 2, $key3 => 3}, table => $table1);
|
| ... | ... |
@@ -1764,7 +1764,7 @@ is($dbi->select(table => $table1)->one->{$key2}, 2);
|
| 1764 | 1764 |
is($dbi->select(table => $table1)->one->{$key3}, 4);
|
| 1765 | 1765 |
|
| 1766 | 1766 |
test 'select'; |
| 1767 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1767 |
+$dbi = DBIx::Custom->connect; |
|
| 1768 | 1768 |
eval { $dbi->execute("drop table $table1") };
|
| 1769 | 1769 |
$dbi->execute($create_table1_2); |
| 1770 | 1770 |
$dbi->insert({$key1 => 1, $key2 => 2, $key3 => 3}, table => $table1);
|
| ... | ... |
@@ -1881,7 +1881,7 @@ is_deeply($result->one, |
| 1881 | 1881 |
{$key1 => 1, $key2 => 2, "${table2}__$key1" => 1, "${table2}__$key3" => 3});
|
| 1882 | 1882 |
|
| 1883 | 1883 |
test 'values_clause'; |
| 1884 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1884 |
+$dbi = DBIx::Custom->connect; |
|
| 1885 | 1885 |
eval { $dbi->execute("drop table $table1") };
|
| 1886 | 1886 |
$dbi->execute($create_table1_2); |
| 1887 | 1887 |
$param = {$key1 => 1, $key2 => 2};
|
| ... | ... |
@@ -1893,7 +1893,7 @@ $dbi->execute($sql, $param, table => $table1); |
| 1893 | 1893 |
is($dbi->select(table => $table1)->one->{$key1}, 1);
|
| 1894 | 1894 |
is($dbi->select(table => $table1)->one->{$key2}, 2);
|
| 1895 | 1895 |
|
| 1896 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1896 |
+$dbi = DBIx::Custom->connect; |
|
| 1897 | 1897 |
eval { $dbi->execute("drop table $table1") };
|
| 1898 | 1898 |
$dbi->execute($create_table1_2); |
| 1899 | 1899 |
$param = {$key1 => 1, $key2 => 2};
|
| ... | ... |
@@ -1961,7 +1961,7 @@ is_deeply($result->one, |
| 1961 | 1961 |
{$key1 => 1, "$table2.$key1" => 1});
|
| 1962 | 1962 |
|
| 1963 | 1963 |
test 'merge_param'; |
| 1964 |
-$dbi = DBIx::Custom::Next->new; |
|
| 1964 |
+$dbi = DBIx::Custom->new; |
|
| 1965 | 1965 |
$params = [ |
| 1966 | 1966 |
{$key1 => 1, $key2 => 2, $key3 => 3},
|
| 1967 | 1967 |
{$key1 => 1, $key2 => 2},
|
| ... | ... |
@@ -1978,7 +1978,7 @@ $param = $dbi->merge_param($params->[0], $params->[1]); |
| 1978 | 1978 |
is_deeply($param, {$key1 => [1, 2, 3, 4], $key2 => [1, 2, 3], $key3 => [1, 2, 3]});
|
| 1979 | 1979 |
|
| 1980 | 1980 |
test 'select() param option'; |
| 1981 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 1981 |
+$dbi = DBIx::Custom->connect; |
|
| 1982 | 1982 |
eval { $dbi->execute("drop table $table1") };
|
| 1983 | 1983 |
$dbi->execute($create_table1); |
| 1984 | 1984 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -2008,7 +2008,7 @@ $rows = $dbi->select( |
| 2008 | 2008 |
is_deeply($rows, [{"${table1}_$key1" => 2, $key2 => 3, $key3 => 5}]);
|
| 2009 | 2009 |
|
| 2010 | 2010 |
test 'select() string where'; |
| 2011 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2011 |
+$dbi = DBIx::Custom->connect; |
|
| 2012 | 2012 |
eval { $dbi->execute("drop table $table1") };
|
| 2013 | 2013 |
$dbi->execute($create_table1); |
| 2014 | 2014 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -2022,7 +2022,7 @@ $rows = $dbi->select( |
| 2022 | 2022 |
)->all; |
| 2023 | 2023 |
is_deeply($rows, [{$key1 => 1, $key2 => 2}]);
|
| 2024 | 2024 |
|
| 2025 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2025 |
+$dbi = DBIx::Custom->connect; |
|
| 2026 | 2026 |
eval { $dbi->execute("drop table $table1") };
|
| 2027 | 2027 |
$dbi->execute($create_table1); |
| 2028 | 2028 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -2036,7 +2036,7 @@ $rows = $dbi->select( |
| 2036 | 2036 |
)->all; |
| 2037 | 2037 |
is_deeply($rows, [{$key1 => 1, $key2 => 2}]);
|
| 2038 | 2038 |
|
| 2039 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2039 |
+$dbi = DBIx::Custom->connect; |
|
| 2040 | 2040 |
eval { $dbi->execute("drop table $table1") };
|
| 2041 | 2041 |
$dbi->execute($create_table1); |
| 2042 | 2042 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -2051,7 +2051,7 @@ $rows = $dbi->select( |
| 2051 | 2051 |
is_deeply($rows, [{$key1 => 1, $key2 => 2}]);
|
| 2052 | 2052 |
|
| 2053 | 2053 |
test 'delete() string where'; |
| 2054 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2054 |
+$dbi = DBIx::Custom->connect; |
|
| 2055 | 2055 |
eval { $dbi->execute("drop table $table1") };
|
| 2056 | 2056 |
$dbi->execute($create_table1); |
| 2057 | 2057 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -2066,7 +2066,7 @@ $dbi->delete( |
| 2066 | 2066 |
$rows = $dbi->select(table => $table1)->all; |
| 2067 | 2067 |
is_deeply($rows, [{$key1 => 2, $key2 => 3}]);
|
| 2068 | 2068 |
|
| 2069 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2069 |
+$dbi = DBIx::Custom->connect; |
|
| 2070 | 2070 |
eval { $dbi->execute("drop table $table1") };
|
| 2071 | 2071 |
$dbi->execute($create_table1); |
| 2072 | 2072 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -2083,7 +2083,7 @@ is_deeply($rows, [{$key1 => 2, $key2 => 3}]);
|
| 2083 | 2083 |
|
| 2084 | 2084 |
|
| 2085 | 2085 |
test 'update() string where'; |
| 2086 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2086 |
+$dbi = DBIx::Custom->connect; |
|
| 2087 | 2087 |
eval { $dbi->execute("drop table $table1") };
|
| 2088 | 2088 |
$dbi->execute($create_table1); |
| 2089 | 2089 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -2098,7 +2098,7 @@ $dbi->update( |
| 2098 | 2098 |
$rows = $dbi->select(table => $table1)->all; |
| 2099 | 2099 |
is_deeply($rows, [{$key1 => 5, $key2 => 2}]);
|
| 2100 | 2100 |
|
| 2101 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2101 |
+$dbi = DBIx::Custom->connect; |
|
| 2102 | 2102 |
eval { $dbi->execute("drop table $table1") };
|
| 2103 | 2103 |
$dbi->execute($create_table1); |
| 2104 | 2104 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -2114,7 +2114,7 @@ $rows = $dbi->select(table => $table1)->all; |
| 2114 | 2114 |
is_deeply($rows, [{$key1 => 5, $key2 => 2}]);
|
| 2115 | 2115 |
|
| 2116 | 2116 |
test 'insert id and primary_key option'; |
| 2117 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2117 |
+$dbi = DBIx::Custom->connect; |
|
| 2118 | 2118 |
eval { $dbi->execute("drop table $table1") };
|
| 2119 | 2119 |
$dbi->execute($create_table1_2); |
| 2120 | 2120 |
$dbi->insert( |
| ... | ... |
@@ -2139,7 +2139,7 @@ is($dbi->select(table => $table1)->one->{$key1}, 0);
|
| 2139 | 2139 |
is($dbi->select(table => $table1)->one->{$key2}, 2);
|
| 2140 | 2140 |
is($dbi->select(table => $table1)->one->{$key3}, 3);
|
| 2141 | 2141 |
|
| 2142 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2142 |
+$dbi = DBIx::Custom->connect; |
|
| 2143 | 2143 |
eval { $dbi->execute("drop table $table1") };
|
| 2144 | 2144 |
$dbi->execute($create_table1_2); |
| 2145 | 2145 |
$dbi->insert( |
| ... | ... |
@@ -2152,7 +2152,7 @@ is($dbi->select(table => $table1)->one->{$key1}, 1);
|
| 2152 | 2152 |
ok(!$dbi->select(table => $table1)->one->{$key2});
|
| 2153 | 2153 |
is($dbi->select(table => $table1)->one->{$key3}, 3);
|
| 2154 | 2154 |
|
| 2155 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2155 |
+$dbi = DBIx::Custom->connect; |
|
| 2156 | 2156 |
eval { $dbi->execute("drop table $table1") };
|
| 2157 | 2157 |
$dbi->execute($create_table1_2); |
| 2158 | 2158 |
$dbi->insert( |
| ... | ... |
@@ -2165,7 +2165,7 @@ is($dbi->select(table => $table1)->one->{$key1}, 1);
|
| 2165 | 2165 |
is($dbi->select(table => $table1)->one->{$key2}, 2);
|
| 2166 | 2166 |
is($dbi->select(table => $table1)->one->{$key3}, 3);
|
| 2167 | 2167 |
|
| 2168 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2168 |
+$dbi = DBIx::Custom->connect; |
|
| 2169 | 2169 |
eval { $dbi->execute("drop table $table1") };
|
| 2170 | 2170 |
$dbi->execute($create_table1_2); |
| 2171 | 2171 |
$param = {$key3 => 3, $key2 => 4};
|
| ... | ... |
@@ -2180,7 +2180,7 @@ is($dbi->select(table => $table1)->one->{$key2}, 4);
|
| 2180 | 2180 |
is($dbi->select(table => $table1)->one->{$key3}, 3);
|
| 2181 | 2181 |
is_deeply($param, {$key3 => 3, $key2 => 4});
|
| 2182 | 2182 |
|
| 2183 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2183 |
+$dbi = DBIx::Custom->connect; |
|
| 2184 | 2184 |
eval { $dbi->execute("drop table $table1") };
|
| 2185 | 2185 |
$dbi->execute($create_table1_2); |
| 2186 | 2186 |
$param = {$key3 => 3, $key2 => 4};
|
| ... | ... |
@@ -2191,7 +2191,7 @@ $dbi->insert( |
| 2191 | 2191 |
id => [1, 2], |
| 2192 | 2192 |
query => 1 |
| 2193 | 2193 |
); |
| 2194 |
-is(ref $query, 'HASH'); |
|
| 2194 |
+ok(ref $query); |
|
| 2195 | 2195 |
is_deeply($param, {$key3 => 3, $key2 => 4});
|
| 2196 | 2196 |
|
| 2197 | 2197 |
test 'model insert id and primary_key option'; |
| ... | ... |
@@ -2222,7 +2222,7 @@ is($row->{$key2}, 2);
|
| 2222 | 2222 |
is($row->{$key3}, 3);
|
| 2223 | 2223 |
|
| 2224 | 2224 |
test 'update and id option'; |
| 2225 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2225 |
+$dbi = DBIx::Custom->connect; |
|
| 2226 | 2226 |
eval { $dbi->execute("drop table $table1") };
|
| 2227 | 2227 |
$dbi->execute($create_table1_2); |
| 2228 | 2228 |
$dbi->insert({$key1 => 1, $key2 => 2, $key3 => 3}, table => $table1);
|
| ... | ... |
@@ -2248,7 +2248,7 @@ is($dbi->select(table => $table1)->one->{$key1}, 0);
|
| 2248 | 2248 |
is($dbi->select(table => $table1)->one->{$key2}, 2);
|
| 2249 | 2249 |
is($dbi->select(table => $table1)->one->{$key3}, 4);
|
| 2250 | 2250 |
|
| 2251 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2251 |
+$dbi = DBIx::Custom->connect; |
|
| 2252 | 2252 |
eval { $dbi->execute("drop table $table1") };
|
| 2253 | 2253 |
$dbi->execute($create_table1_2); |
| 2254 | 2254 |
$dbi->insert({$key1 => 1, $key2 => 2, $key3 => 3}, table => $table1);
|
| ... | ... |
@@ -2280,7 +2280,7 @@ is($row->{$key3}, 4);
|
| 2280 | 2280 |
|
| 2281 | 2281 |
|
| 2282 | 2282 |
test 'delete and id option'; |
| 2283 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2283 |
+$dbi = DBIx::Custom->connect; |
|
| 2284 | 2284 |
eval { $dbi->execute("drop table $table1") };
|
| 2285 | 2285 |
$dbi->execute($create_table1_2); |
| 2286 | 2286 |
$dbi->insert({$key1 => 1, $key2 => 2, $key3 => 3}, table => $table1);
|
| ... | ... |
@@ -2320,7 +2320,7 @@ is_deeply($dbi->select(table => $table3)->all, []); |
| 2320 | 2320 |
|
| 2321 | 2321 |
|
| 2322 | 2322 |
test 'select and id option'; |
| 2323 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2323 |
+$dbi = DBIx::Custom->connect; |
|
| 2324 | 2324 |
eval { $dbi->execute("drop table $table1") };
|
| 2325 | 2325 |
$dbi->execute($create_table1_2); |
| 2326 | 2326 |
$dbi->insert({$key1 => 1, $key2 => 2, $key3 => 3}, table => $table1);
|
| ... | ... |
@@ -2396,7 +2396,7 @@ is_deeply($result->one, |
| 2396 | 2396 |
{"$table2.$key1" => 1, "$table2.$key3" => 3});
|
| 2397 | 2397 |
|
| 2398 | 2398 |
test 'separator'; |
| 2399 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2399 |
+$dbi = DBIx::Custom->connect; |
|
| 2400 | 2400 |
$dbi->user_table_info($user_table_info); |
| 2401 | 2401 |
eval { $dbi->execute("drop table $table1") };
|
| 2402 | 2402 |
eval { $dbi->execute("drop table $table2") };
|
| ... | ... |
@@ -2455,7 +2455,7 @@ is_deeply($result->one, |
| 2455 | 2455 |
is_deeply($model2->select->one, {$key1 => 1, $key3 => 3});
|
| 2456 | 2456 |
|
| 2457 | 2457 |
|
| 2458 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2458 |
+$dbi = DBIx::Custom->connect; |
|
| 2459 | 2459 |
$dbi->user_table_info($user_table_info); |
| 2460 | 2460 |
eval { $dbi->execute("drop table $table1") };
|
| 2461 | 2461 |
eval { $dbi->execute("drop table $table2") };
|
| ... | ... |
@@ -2477,12 +2477,12 @@ $result->filter($key1 => sub { $_[0] * 2 });
|
| 2477 | 2477 |
is_deeply($result->one, {$key1 => 2});
|
| 2478 | 2478 |
|
| 2479 | 2479 |
test 'available_datetype'; |
| 2480 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2480 |
+$dbi = DBIx::Custom->connect; |
|
| 2481 | 2481 |
ok($dbi->can('available_datatype'));
|
| 2482 | 2482 |
|
| 2483 | 2483 |
|
| 2484 | 2484 |
test 'select prefix option'; |
| 2485 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2485 |
+$dbi = DBIx::Custom->connect; |
|
| 2486 | 2486 |
eval { $dbi->execute("drop table $table1") };
|
| 2487 | 2487 |
$dbi->execute($create_table1); |
| 2488 | 2488 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -2491,7 +2491,7 @@ is_deeply($rows, [{$key1 => 1, $key2 => 2}], "table");
|
| 2491 | 2491 |
|
| 2492 | 2492 |
|
| 2493 | 2493 |
test 'mapper'; |
| 2494 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2494 |
+$dbi = DBIx::Custom->connect; |
|
| 2495 | 2495 |
$param = $dbi->mapper(param => {id => 1, author => 'Ken', price => 1900})->map(
|
| 2496 | 2496 |
id => {key => "$table1.id"},
|
| 2497 | 2497 |
author => ["$table1.author" => sub { '%' . $_[0] . '%' }],
|
| ... | ... |
@@ -2500,7 +2500,7 @@ $param = $dbi->mapper(param => {id => 1, author => 'Ken', price => 1900})->map(
|
| 2500 | 2500 |
is_deeply($param, {"$table1.id" => 1, "$table1.author" => '%Ken%',
|
| 2501 | 2501 |
"$table1.price" => 1900}); |
| 2502 | 2502 |
|
| 2503 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2503 |
+$dbi = DBIx::Custom->connect; |
|
| 2504 | 2504 |
$param = $dbi->mapper(param => {id => 1, author => 'Ken', price => 1900})->map(
|
| 2505 | 2505 |
id => {key => "$table1.id"},
|
| 2506 | 2506 |
author => ["$table1.author" => $dbi->like_value], |
| ... | ... |
@@ -2686,7 +2686,7 @@ $param = $dbi->mapper(param => {id => 'a', author => 'b', price => 'c'}, pass =>
|
| 2686 | 2686 |
is_deeply($param, {id => 'a', author => 'b', 'book.price' => 'c'});
|
| 2687 | 2687 |
|
| 2688 | 2688 |
test 'order'; |
| 2689 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2689 |
+$dbi = DBIx::Custom->connect; |
|
| 2690 | 2690 |
eval { $dbi->execute("drop table $table1") };
|
| 2691 | 2691 |
$dbi->execute($create_table1); |
| 2692 | 2692 |
$dbi->insert({$key1 => 1, $key2 => 1}, table => $table1);
|
| ... | ... |
@@ -2714,7 +2714,7 @@ is_deeply($result->all, [{"$table1-$key1" => 1, "$table1-$key2" => 3},
|
| 2714 | 2714 |
{"$table1-$key1" => 2, "$table1-$key2" => 2}]);
|
| 2715 | 2715 |
|
| 2716 | 2716 |
test 'last_sql'; |
| 2717 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2717 |
+$dbi = DBIx::Custom->connect; |
|
| 2718 | 2718 |
eval { $dbi->execute("drop table $table1") };
|
| 2719 | 2719 |
$dbi->execute($create_table1); |
| 2720 | 2720 |
$dbi->execute("select * from $table1");
|
| ... | ... |
@@ -2723,8 +2723,8 @@ is($dbi->last_sql, "select * from $table1"); |
| 2723 | 2723 |
eval{$dbi->execute("aaa")};
|
| 2724 | 2724 |
is($dbi->last_sql, 'aaa'); |
| 2725 | 2725 |
|
| 2726 |
-test 'DBIx::Custom::Next header'; |
|
| 2727 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2726 |
+test 'DBIx::Custom header'; |
|
| 2727 |
+$dbi = DBIx::Custom->connect; |
|
| 2728 | 2728 |
eval { $dbi->execute("drop table $table1") };
|
| 2729 | 2729 |
$dbi->execute($create_table1); |
| 2730 | 2730 |
$result = $dbi->execute("select $key1 as h1, $key2 as h2 from $table1");
|
| ... | ... |
@@ -2776,7 +2776,7 @@ $result = $model->select( |
| 2776 | 2776 |
is_deeply($result->all, [{"$table1.$key2" => 2}]);
|
| 2777 | 2777 |
|
| 2778 | 2778 |
test 'result'; |
| 2779 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2779 |
+$dbi = DBIx::Custom->connect; |
|
| 2780 | 2780 |
eval { $dbi->execute("drop table $table1") };
|
| 2781 | 2781 |
$dbi->execute($create_table1); |
| 2782 | 2782 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -2796,7 +2796,7 @@ while (my $row = $result->fetch_hash) {
|
| 2796 | 2796 |
} |
| 2797 | 2797 |
is_deeply(\@rows, [{$key1 => 1, $key2 => 2}, {$key1 => 3, $key2 => 4}]);
|
| 2798 | 2798 |
|
| 2799 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2799 |
+$dbi = DBIx::Custom->connect; |
|
| 2800 | 2800 |
eval { $dbi->execute("drop table $table1") };
|
| 2801 | 2801 |
$dbi->execute($create_table1); |
| 2802 | 2802 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -2829,7 +2829,7 @@ $result->filter({$key1 => 'three_times'});
|
| 2829 | 2829 |
$rows = $result->fetch_hash_all; |
| 2830 | 2830 |
is_deeply($rows, [{$key1 => 3, $key2 => 2}, {$key1 => 9, $key2 => 4}], "hash");
|
| 2831 | 2831 |
|
| 2832 |
-test 'DBIx::Custom::Next::Result fetch_multi'; |
|
| 2832 |
+test 'DBIx::Custom::Result fetch_multi'; |
|
| 2833 | 2833 |
eval { $dbi->execute("drop table $table1") };
|
| 2834 | 2834 |
$dbi->execute($create_table1); |
| 2835 | 2835 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -2843,7 +2843,7 @@ is_deeply($rows, [[5, 6]]); |
| 2843 | 2843 |
$rows = $result->fetch_multi(2); |
| 2844 | 2844 |
ok(!$rows); |
| 2845 | 2845 |
|
| 2846 |
-test 'DBIx::Custom::Next::Result fetch_hash_multi'; |
|
| 2846 |
+test 'DBIx::Custom::Result fetch_hash_multi'; |
|
| 2847 | 2847 |
eval { $dbi->execute("drop table $table1") };
|
| 2848 | 2848 |
$dbi->execute($create_table1); |
| 2849 | 2849 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -2858,7 +2858,7 @@ $rows = $result->fetch_hash_multi(2); |
| 2858 | 2858 |
ok(!$rows); |
| 2859 | 2859 |
|
| 2860 | 2860 |
test 'select() after_build_sql option'; |
| 2861 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2861 |
+$dbi = DBIx::Custom->connect; |
|
| 2862 | 2862 |
$dbi->user_table_info($user_table_info); |
| 2863 | 2863 |
eval { $dbi->execute("drop table $table1") };
|
| 2864 | 2864 |
$dbi->execute($create_table1); |
| ... | ... |
@@ -2876,7 +2876,7 @@ $rows = $dbi->select( |
| 2876 | 2876 |
is_deeply($rows, [{$key1 => 1}]);
|
| 2877 | 2877 |
|
| 2878 | 2878 |
test 'select() after_build_sql option'; |
| 2879 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2879 |
+$dbi = DBIx::Custom->connect; |
|
| 2880 | 2880 |
$dbi->user_table_info($user_table_info); |
| 2881 | 2881 |
eval { $dbi->execute("drop table $table1") };
|
| 2882 | 2882 |
$dbi->execute($create_table1); |
| ... | ... |
@@ -2943,7 +2943,7 @@ is_deeply($result->one, |
| 2943 | 2943 |
{"$table2_alias-$key1" => 1, "$table2_alias-$key3" => 4});
|
| 2944 | 2944 |
|
| 2945 | 2945 |
test 'create_model'; |
| 2946 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2946 |
+$dbi = DBIx::Custom->connect; |
|
| 2947 | 2947 |
$dbi->user_table_info($user_table_info); |
| 2948 | 2948 |
eval { $dbi->execute("drop table $table1") };
|
| 2949 | 2949 |
eval { $dbi->execute("drop table $table2") };
|
| ... | ... |
@@ -2976,7 +2976,7 @@ is_deeply($result->one, |
| 2976 | 2976 |
is_deeply($model2->select->one, {$key1 => 1, $key3 => 3});
|
| 2977 | 2977 |
|
| 2978 | 2978 |
test 'model helper'; |
| 2979 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2979 |
+$dbi = DBIx::Custom->connect; |
|
| 2980 | 2980 |
eval { $dbi->execute("drop table $table2") };
|
| 2981 | 2981 |
$dbi->execute($create_table2); |
| 2982 | 2982 |
$dbi->insert({$key1 => 1, $key3 => 3}, table => $table2);
|
| ... | ... |
@@ -2987,7 +2987,7 @@ $model->helper(foo => sub { shift->select(@_) });
|
| 2987 | 2987 |
is_deeply($model->foo->one, {$key1 => 1, $key3 => 3});
|
| 2988 | 2988 |
|
| 2989 | 2989 |
test 'model helper'; |
| 2990 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 2990 |
+$dbi = DBIx::Custom->connect; |
|
| 2991 | 2991 |
eval { $dbi->execute("drop table $table2") };
|
| 2992 | 2992 |
$dbi->execute($create_table2); |
| 2993 | 2993 |
$dbi->insert({$key1 => 1, $key3 => 3}, table => $table2);
|
| ... | ... |
@@ -2998,7 +2998,7 @@ $model->helper(foo => sub { shift->select(@_) });
|
| 2998 | 2998 |
is_deeply($model->foo->one, {$key1 => 1, $key3 => 3});
|
| 2999 | 2999 |
|
| 3000 | 3000 |
test 'assign_clause'; |
| 3001 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3001 |
+$dbi = DBIx::Custom->connect; |
|
| 3002 | 3002 |
eval { $dbi->execute("drop table $table1") };
|
| 3003 | 3003 |
$dbi->execute($create_table1_2); |
| 3004 | 3004 |
$dbi->insert({$key1 => 1, $key2 => 2, $key3 => 3, $key4 => 4, $key5 => 5}, table => $table1);
|
| ... | ... |
@@ -3018,7 +3018,7 @@ is_deeply($rows, [{$key1 => 1, $key2 => 11, $key3 => 3, $key4 => 4, $key5 => 5},
|
| 3018 | 3018 |
"basic"); |
| 3019 | 3019 |
|
| 3020 | 3020 |
|
| 3021 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3021 |
+$dbi = DBIx::Custom->connect; |
|
| 3022 | 3022 |
eval { $dbi->execute("drop table $table1") };
|
| 3023 | 3023 |
$dbi->execute($create_table1_2); |
| 3024 | 3024 |
$dbi->insert({$key1 => 1, $key2 => 2, $key3 => 3, $key4 => 4, $key5 => 5}, table => $table1);
|
| ... | ... |
@@ -3037,7 +3037,7 @@ is_deeply($rows, [{$key1 => 1, $key2 => 11, $key3 => 33, $key4 => 4, $key5 => 5}
|
| 3037 | 3037 |
{$key1 => 6, $key2 => 7, $key3 => 8, $key4 => 9, $key5 => 10}],
|
| 3038 | 3038 |
"basic"); |
| 3039 | 3039 |
|
| 3040 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3040 |
+$dbi = DBIx::Custom->connect; |
|
| 3041 | 3041 |
eval { $dbi->execute("drop table $table1") };
|
| 3042 | 3042 |
$dbi->execute($create_table1_2); |
| 3043 | 3043 |
$dbi->insert({$key1 => 1, $key2 => 2, $key3 => 3, $key4 => 4, $key5 => 5}, table => $table1);
|
| ... | ... |
@@ -3057,7 +3057,7 @@ is_deeply($rows, [{$key1 => 1, $key2 => 11, $key3 => 33, $key4 => 4, $key5 => 5}
|
| 3057 | 3057 |
"update param no_set"); |
| 3058 | 3058 |
|
| 3059 | 3059 |
|
| 3060 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3060 |
+$dbi = DBIx::Custom->connect; |
|
| 3061 | 3061 |
eval { $dbi->execute("drop table $table1") };
|
| 3062 | 3062 |
$dbi->execute($create_table1_2); |
| 3063 | 3063 |
$dbi->insert({$key1 => 1, $key2 => 2, $key3 => 3, $key4 => 4, $key5 => 5}, table => $table1);
|
| ... | ... |
@@ -3153,7 +3153,7 @@ is_deeply([sort @{$dbi->model($table1)->columns}], [$key1, $key2]);
|
| 3153 | 3153 |
is_deeply([sort @{$dbi->model($table2)->columns}], [$key1, $key3]);
|
| 3154 | 3154 |
|
| 3155 | 3155 |
test 'each_column'; |
| 3156 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3156 |
+$dbi = DBIx::Custom->connect; |
|
| 3157 | 3157 |
eval { $dbi->execute("drop table ${q}table$p") };
|
| 3158 | 3158 |
eval { $dbi->execute("drop table $table1") };
|
| 3159 | 3159 |
eval { $dbi->execute("drop table $table2") };
|
| ... | ... |
@@ -3182,7 +3182,7 @@ is_deeply($infos, |
| 3182 | 3182 |
); |
| 3183 | 3183 |
|
| 3184 | 3184 |
test 'each_table'; |
| 3185 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3185 |
+$dbi = DBIx::Custom->connect; |
|
| 3186 | 3186 |
eval { $dbi->execute("drop table $table1") };
|
| 3187 | 3187 |
eval { $dbi->execute("drop table $table2") };
|
| 3188 | 3188 |
$dbi->execute($create_table2); |
| ... | ... |
@@ -3205,7 +3205,7 @@ is_deeply($infos, |
| 3205 | 3205 |
] |
| 3206 | 3206 |
); |
| 3207 | 3207 |
|
| 3208 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3208 |
+$dbi = DBIx::Custom->connect; |
|
| 3209 | 3209 |
eval { $dbi->execute("drop table $table1") };
|
| 3210 | 3210 |
eval { $dbi->execute("drop table $table2") };
|
| 3211 | 3211 |
$dbi->execute($create_table2); |
| ... | ... |
@@ -3236,7 +3236,7 @@ $dbi->execute($create_table1_type); |
| 3236 | 3236 |
$user_column_info = $dbi->get_column_info(exclude_table => $dbi->exclude_table); |
| 3237 | 3237 |
|
| 3238 | 3238 |
|
| 3239 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3239 |
+$dbi = DBIx::Custom->connect; |
|
| 3240 | 3240 |
eval { $dbi->execute("drop table $table1") };
|
| 3241 | 3241 |
$dbi->execute($create_table1_type); |
| 3242 | 3242 |
|
| ... | ... |
@@ -3250,7 +3250,7 @@ $dbi->insert({$key1 => '01-01'}, table => $table1);
|
| 3250 | 3250 |
$result = $dbi->select(table => $table1); |
| 3251 | 3251 |
like($result->one->{$key1}, qr/^2010-01-01/);
|
| 3252 | 3252 |
|
| 3253 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3253 |
+$dbi = DBIx::Custom->connect; |
|
| 3254 | 3254 |
eval { $dbi->execute("drop table $table1") };
|
| 3255 | 3255 |
$dbi->execute($create_table1_type); |
| 3256 | 3256 |
$dbi->user_column_info($user_column_info); |
| ... | ... |
@@ -3269,7 +3269,7 @@ $row = $result->one; |
| 3269 | 3269 |
like($row->{$key1}, qr/^2010-01-03/);
|
| 3270 | 3270 |
like($row->{$key2}, qr/^2010-01-01 01:01:03/);
|
| 3271 | 3271 |
|
| 3272 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3272 |
+$dbi = DBIx::Custom->connect; |
|
| 3273 | 3273 |
eval { $dbi->execute("drop table $table1") };
|
| 3274 | 3274 |
$dbi->execute($create_table1_type); |
| 3275 | 3275 |
$dbi->insert({$key1 => '2010-01-03', $key2 => '2010-01-01 01:01:03'}, table => $table1);
|
| ... | ... |
@@ -3291,7 +3291,7 @@ $row = $result->one; |
| 3291 | 3291 |
like($row->{$key1}, qr/^2010-01-03/);
|
| 3292 | 3292 |
like($row->{$key2}, qr/^2010-01-01 01:01:03/);
|
| 3293 | 3293 |
|
| 3294 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3294 |
+$dbi = DBIx::Custom->connect; |
|
| 3295 | 3295 |
eval { $dbi->execute("drop table $table1") };
|
| 3296 | 3296 |
$dbi->execute($create_table1_type); |
| 3297 | 3297 |
$dbi->insert({$key1 => '2010-01-03', $key2 => '2010-01-01 01:01:03'}, table => $table1);
|
| ... | ... |
@@ -3314,7 +3314,7 @@ $row = $result->one; |
| 3314 | 3314 |
like($row->{$key1}, qr/^2010-01-03/);
|
| 3315 | 3315 |
like($row->{$key2}, qr/2010-01-01 01:01:03/);
|
| 3316 | 3316 |
|
| 3317 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3317 |
+$dbi = DBIx::Custom->connect; |
|
| 3318 | 3318 |
eval { $dbi->execute("drop table $table1") };
|
| 3319 | 3319 |
$dbi->execute($create_table1_type); |
| 3320 | 3320 |
$dbi->register_filter(convert => sub {
|
| ... | ... |
@@ -3340,7 +3340,7 @@ like($row->[0], qr/^2010-03-03/); |
| 3340 | 3340 |
like($row->[1], qr/^2010-03-03/); |
| 3341 | 3341 |
|
| 3342 | 3342 |
test 'type_rule and filter order'; |
| 3343 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3343 |
+$dbi = DBIx::Custom->connect; |
|
| 3344 | 3344 |
eval { $dbi->execute("drop table $table1") };
|
| 3345 | 3345 |
$dbi->execute($create_table1_type); |
| 3346 | 3346 |
$dbi->user_column_info($user_column_info); |
| ... | ... |
@@ -3365,7 +3365,7 @@ $result->filter($key1 => sub { my $v = shift || ''; $v =~ s/8/9/; return $v });
|
| 3365 | 3365 |
like($result->fetch_first->[0], qr/^2010-01-09/); |
| 3366 | 3366 |
|
| 3367 | 3367 |
|
| 3368 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3368 |
+$dbi = DBIx::Custom->connect; |
|
| 3369 | 3369 |
eval { $dbi->execute("drop table $table1") };
|
| 3370 | 3370 |
$dbi->execute($create_table1_type); |
| 3371 | 3371 |
$dbi->user_column_info($user_column_info); |
| ... | ... |
@@ -3392,7 +3392,7 @@ $result->filter($key1 => sub { my $v = shift || ''; $v =~ s/8/9/; return $v });
|
| 3392 | 3392 |
like($result->fetch_first->[0], qr/^2010-01-09/); |
| 3393 | 3393 |
|
| 3394 | 3394 |
test 'type_rule_off'; |
| 3395 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3395 |
+$dbi = DBIx::Custom->connect; |
|
| 3396 | 3396 |
eval { $dbi->execute("drop table $table1") };
|
| 3397 | 3397 |
$dbi->execute($create_table1_type); |
| 3398 | 3398 |
$dbi->user_column_info($user_column_info); |
| ... | ... |
@@ -3408,7 +3408,7 @@ $dbi->insert({$key1 => '2010-01-03'}, table => $table1, type_rule_off => 1);
|
| 3408 | 3408 |
$result = $dbi->select(table => $table1, type_rule_off => 1); |
| 3409 | 3409 |
like($result->type_rule_off->fetch->[0], qr/^2010-01-03/); |
| 3410 | 3410 |
|
| 3411 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3411 |
+$dbi = DBIx::Custom->connect; |
|
| 3412 | 3412 |
eval { $dbi->execute("drop table $table1") };
|
| 3413 | 3413 |
$dbi->execute($create_table1_type); |
| 3414 | 3414 |
$dbi->user_column_info($user_column_info); |
| ... | ... |
@@ -3424,7 +3424,7 @@ $dbi->insert({$key1 => '2010-01-03'}, table => $table1, type_rule_off => 1);
|
| 3424 | 3424 |
$result = $dbi->select(table => $table1, type_rule_off => 1); |
| 3425 | 3425 |
like($result->one->{$key1}, qr/^2010-01-04/);
|
| 3426 | 3426 |
|
| 3427 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3427 |
+$dbi = DBIx::Custom->connect; |
|
| 3428 | 3428 |
eval { $dbi->execute("drop table $table1") };
|
| 3429 | 3429 |
$dbi->execute($create_table1_type); |
| 3430 | 3430 |
$dbi->user_column_info($user_column_info); |
| ... | ... |
@@ -3440,7 +3440,7 @@ $dbi->insert({$key1 => '2010-01-03'}, table => $table1);
|
| 3440 | 3440 |
$result = $dbi->select(table => $table1); |
| 3441 | 3441 |
like($result->one->{$key1}, qr/^2010-01-05/);
|
| 3442 | 3442 |
|
| 3443 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3443 |
+$dbi = DBIx::Custom->connect; |
|
| 3444 | 3444 |
eval { $dbi->execute("drop table $table1") };
|
| 3445 | 3445 |
$dbi->execute($create_table1_type); |
| 3446 | 3446 |
$dbi->user_column_info($user_column_info); |
| ... | ... |
@@ -3456,7 +3456,7 @@ $dbi->insert({$key1 => '2010-01-03'}, table => $table1);
|
| 3456 | 3456 |
$result = $dbi->select(table => $table1); |
| 3457 | 3457 |
like($result->fetch->[0], qr/2010-01-05/); |
| 3458 | 3458 |
|
| 3459 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3459 |
+$dbi = DBIx::Custom->connect; |
|
| 3460 | 3460 |
eval { $dbi->execute("drop table $table1") };
|
| 3461 | 3461 |
$dbi->execute($create_table1_type); |
| 3462 | 3462 |
$dbi->register_filter(ppp => sub { my $v = shift || ''; $v =~ s/3/4/; return $v });
|
| ... | ... |
@@ -3477,7 +3477,7 @@ eval{$dbi->type_rule(
|
| 3477 | 3477 |
)}; |
| 3478 | 3478 |
like($@, qr/not registered/); |
| 3479 | 3479 |
|
| 3480 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3480 |
+$dbi = DBIx::Custom->connect; |
|
| 3481 | 3481 |
eval { $dbi->execute("drop table $table1") };
|
| 3482 | 3482 |
$dbi->execute($create_table1_type); |
| 3483 | 3483 |
eval {
|
| ... | ... |
@@ -3498,7 +3498,7 @@ eval {
|
| 3498 | 3498 |
}; |
| 3499 | 3499 |
like($@, qr/lower/); |
| 3500 | 3500 |
|
| 3501 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3501 |
+$dbi = DBIx::Custom->connect; |
|
| 3502 | 3502 |
eval { $dbi->execute("drop table $table1") };
|
| 3503 | 3503 |
$dbi->execute($create_table1_type); |
| 3504 | 3504 |
$dbi->user_column_info($user_column_info); |
| ... | ... |
@@ -3515,7 +3515,7 @@ $result = $dbi->select(table => $table1); |
| 3515 | 3515 |
$result->type_rule_off; |
| 3516 | 3516 |
like($result->one->{$key1}, qr/^2010-01-04/);
|
| 3517 | 3517 |
|
| 3518 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3518 |
+$dbi = DBIx::Custom->connect; |
|
| 3519 | 3519 |
eval { $dbi->execute("drop table $table1") };
|
| 3520 | 3520 |
$dbi->execute($create_table1_type); |
| 3521 | 3521 |
$dbi->user_column_info($user_column_info); |
| ... | ... |
@@ -3581,7 +3581,7 @@ $row = $result->one; |
| 3581 | 3581 |
like($row->{$key1}, qr/^2010-01-03/);
|
| 3582 | 3582 |
like($row->{$key2}, qr/^2010-01-01 01:01:03/);
|
| 3583 | 3583 |
|
| 3584 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3584 |
+$dbi = DBIx::Custom->connect; |
|
| 3585 | 3585 |
eval { $dbi->execute("drop table $table1") };
|
| 3586 | 3586 |
$dbi->execute($create_table1_type); |
| 3587 | 3587 |
$dbi->user_column_info($user_column_info); |
| ... | ... |
@@ -3595,7 +3595,7 @@ $result = $dbi->select(table => $table1); |
| 3595 | 3595 |
$result->filter($key1 => sub { my $v = shift || ''; $v =~ s/4/5/; return $v });
|
| 3596 | 3596 |
like($result->one->{$key1}, qr/^2010-01-05/);
|
| 3597 | 3597 |
|
| 3598 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3598 |
+$dbi = DBIx::Custom->connect; |
|
| 3599 | 3599 |
eval { $dbi->execute("drop table $table1") };
|
| 3600 | 3600 |
$dbi->execute($create_table1_type); |
| 3601 | 3601 |
$dbi->user_column_info($user_column_info); |
| ... | ... |
@@ -3609,7 +3609,7 @@ $result = $dbi->select(table => $table1); |
| 3609 | 3609 |
$result->filter($key1 => sub { my $v = shift || ''; $v =~ s/4/5/; return $v });
|
| 3610 | 3610 |
like($result->fetch->[0], qr/^2010-01-05/); |
| 3611 | 3611 |
|
| 3612 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3612 |
+$dbi = DBIx::Custom->connect; |
|
| 3613 | 3613 |
eval { $dbi->execute("drop table $table1") };
|
| 3614 | 3614 |
$dbi->execute($create_table1_type); |
| 3615 | 3615 |
$dbi->user_column_info($user_column_info); |
| ... | ... |
@@ -3633,7 +3633,7 @@ like($result->type_rule_off->fetch_first->[0], qr/^2010-01-03/); |
| 3633 | 3633 |
$result = $dbi->select(table => $table1); |
| 3634 | 3634 |
like($result->type_rule_on->fetch_first->[0], qr/^2010-01-07/); |
| 3635 | 3635 |
|
| 3636 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3636 |
+$dbi = DBIx::Custom->connect; |
|
| 3637 | 3637 |
eval { $dbi->execute("drop table $table1") };
|
| 3638 | 3638 |
$dbi->execute($create_table1_type); |
| 3639 | 3639 |
$dbi->user_column_info($user_column_info); |
| ... | ... |
@@ -3657,7 +3657,7 @@ like($result->type_rule1_off->fetch_first->[0], qr/^2010-01-05/); |
| 3657 | 3657 |
$result = $dbi->select(table => $table1); |
| 3658 | 3658 |
like($result->type_rule1_on->fetch_first->[0], qr/^2010-01-07/); |
| 3659 | 3659 |
|
| 3660 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3660 |
+$dbi = DBIx::Custom->connect; |
|
| 3661 | 3661 |
eval { $dbi->execute("drop table $table1") };
|
| 3662 | 3662 |
$dbi->execute($create_table1_type); |
| 3663 | 3663 |
$dbi->user_column_info($user_column_info); |
| ... | ... |
@@ -3682,7 +3682,7 @@ $result = $dbi->select(table => $table1); |
| 3682 | 3682 |
like($result->type_rule2_on->fetch_first->[0], qr/^2010-01-07/); |
| 3683 | 3683 |
|
| 3684 | 3684 |
test 'join'; |
| 3685 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3685 |
+$dbi = DBIx::Custom->connect; |
|
| 3686 | 3686 |
eval { $dbi->execute("drop table $table1") };
|
| 3687 | 3687 |
$dbi->execute($create_table1); |
| 3688 | 3688 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -3701,7 +3701,7 @@ $rows = $dbi->select( |
| 3701 | 3701 |
)->all; |
| 3702 | 3702 |
is_deeply($rows, [{"${table1}_$key1" => 1, "${table2}_$key1" => 1, $key2 => 2, $key3 => 5}]);
|
| 3703 | 3703 |
|
| 3704 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3704 |
+$dbi = DBIx::Custom->connect; |
|
| 3705 | 3705 |
eval { $dbi->execute("drop table $table1") };
|
| 3706 | 3706 |
$dbi->execute($create_table1); |
| 3707 | 3707 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -3756,7 +3756,7 @@ $rows = $dbi->select( |
| 3756 | 3756 |
)->all; |
| 3757 | 3757 |
is_deeply($rows, [{"${table1}__$key1" => 1}]);
|
| 3758 | 3758 |
|
| 3759 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3759 |
+$dbi = DBIx::Custom->connect; |
|
| 3760 | 3760 |
eval { $dbi->execute("drop table $table1") };
|
| 3761 | 3761 |
$dbi->execute($create_table1); |
| 3762 | 3762 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -3773,7 +3773,7 @@ is_deeply($rows, [{"${table1}_$key1" => 1, "${table2}_$key1" => 1, $key2 => 2, $
|
| 3773 | 3773 |
'quote'); |
| 3774 | 3774 |
|
| 3775 | 3775 |
|
| 3776 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3776 |
+$dbi = DBIx::Custom->connect; |
|
| 3777 | 3777 |
eval { $dbi->execute("drop table $table1") };
|
| 3778 | 3778 |
$dbi->execute($create_table1); |
| 3779 | 3779 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -3794,7 +3794,7 @@ $rows = $dbi->select( |
| 3794 | 3794 |
)->all; |
| 3795 | 3795 |
is_deeply($rows, [{"${table3}__$key1" => 1}]);
|
| 3796 | 3796 |
|
| 3797 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3797 |
+$dbi = DBIx::Custom->connect; |
|
| 3798 | 3798 |
eval { $dbi->execute("drop table $table1") };
|
| 3799 | 3799 |
eval { $dbi->execute("drop table $table2") };
|
| 3800 | 3800 |
$dbi->execute($create_table1); |
| ... | ... |
@@ -3826,7 +3826,7 @@ $result = $dbi->select( |
| 3826 | 3826 |
); |
| 3827 | 3827 |
is_deeply($result->all, [{"$table2.$key3" => 4}]);
|
| 3828 | 3828 |
|
| 3829 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3829 |
+$dbi = DBIx::Custom->connect; |
|
| 3830 | 3830 |
eval { $dbi->execute("drop table $table1") };
|
| 3831 | 3831 |
eval { $dbi->execute("drop table $table2") };
|
| 3832 | 3832 |
$dbi->execute($create_table1); |
| ... | ... |
@@ -3846,7 +3846,7 @@ $result = $dbi->select( |
| 3846 | 3846 |
); |
| 3847 | 3847 |
is_deeply($result->all, [{"$table2.$key3" => 4}]);
|
| 3848 | 3848 |
|
| 3849 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3849 |
+$dbi = DBIx::Custom->connect; |
|
| 3850 | 3850 |
eval { $dbi->execute("drop table $table1") };
|
| 3851 | 3851 |
eval { $dbi->execute("drop table $table2") };
|
| 3852 | 3852 |
$dbi->execute($create_table1); |
| ... | ... |
@@ -3863,7 +3863,7 @@ $result = $dbi->select( |
| 3863 | 3863 |
); |
| 3864 | 3864 |
is_deeply($result->all, [{"$table2.$key3" => 4}]);
|
| 3865 | 3865 |
|
| 3866 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3866 |
+$dbi = DBIx::Custom->connect; |
|
| 3867 | 3867 |
eval { $dbi->execute("drop table $table1") };
|
| 3868 | 3868 |
eval { $dbi->execute("drop table $table2") };
|
| 3869 | 3869 |
$dbi->execute($create_table1); |
| ... | ... |
@@ -3885,7 +3885,7 @@ $dbi = MyDBI1->connect; |
| 3885 | 3885 |
$model = $dbi->model($table1); |
| 3886 | 3886 |
|
| 3887 | 3887 |
test 'count'; |
| 3888 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 3888 |
+$dbi = DBIx::Custom->connect; |
|
| 3889 | 3889 |
eval { $dbi->execute("drop table $table1") };
|
| 3890 | 3890 |
$dbi->execute($create_table1); |
| 3891 | 3891 |
$dbi->insert({$key1 => 1, $key2 => 2}, table => $table1);
|
| ... | ... |
@@ -3,7 +3,7 @@ package MyDBI1; |
| 3 | 3 |
use strict; |
| 4 | 4 |
use warnings; |
| 5 | 5 |
|
| 6 |
-use base 'DBIx::Custom::Next'; |
|
| 6 |
+use base 'DBIx::Custom'; |
|
| 7 | 7 |
|
| 8 | 8 |
sub connect {
|
| 9 | 9 |
my $self = shift->SUPER::connect(@_); |
| ... | ... |
@@ -1,6 +1,6 @@ |
| 1 | 1 |
package MyModel1::table1; |
| 2 | 2 |
|
| 3 |
-use DBIx::Custom::Next::Model -base; |
|
| 3 |
+use DBIx::Custom::Model -base; |
|
| 4 | 4 |
|
| 5 | 5 |
sub insert {
|
| 6 | 6 |
my ($self, $param) = @_; |
| ... | ... |
@@ -3,7 +3,7 @@ package MyModel1::table2; |
| 3 | 3 |
use strict; |
| 4 | 4 |
use warnings; |
| 5 | 5 |
|
| 6 |
-use base 'DBIx::Custom::Next::Model'; |
|
| 6 |
+use base 'DBIx::Custom::Model'; |
|
| 7 | 7 |
|
| 8 | 8 |
|
| 9 | 9 |
sub insert {
|
| ... | ... |
@@ -1,5 +1,5 @@ |
| 1 | 1 |
package MyModel4; |
| 2 | 2 |
|
| 3 |
-use base 'DBIx::Custom::Next::Model'; |
|
| 3 |
+use base 'DBIx::Custom::Model'; |
|
| 4 | 4 |
|
| 5 | 5 |
1; |
| ... | ... |
@@ -1,5 +1,5 @@ |
| 1 | 1 |
package MyModel5; |
| 2 | 2 |
|
| 3 |
-use base 'DBIx::Custom::Next::Model'; |
|
| 3 |
+use base 'DBIx::Custom::Model'; |
|
| 4 | 4 |
|
| 5 | 5 |
1; |
| ... | ... |
@@ -1,5 +1,5 @@ |
| 1 | 1 |
package MyModel6; |
| 2 | 2 |
|
| 3 |
-use base 'DBIx::Custom::Next::Model'; |
|
| 3 |
+use base 'DBIx::Custom::Model'; |
|
| 4 | 4 |
|
| 5 | 5 |
1; |
| ... | ... |
@@ -1,5 +1,5 @@ |
| 1 | 1 |
package MyModel7; |
| 2 | 2 |
|
| 3 |
-use base 'DBIx::Custom::Next::Model'; |
|
| 3 |
+use base 'DBIx::Custom::Model'; |
|
| 4 | 4 |
|
| 5 | 5 |
1; |
| ... | ... |
@@ -1,4 +1,4 @@ |
| 1 | 1 |
package MyModel8; |
| 2 |
-use DBIx::Custom::Next::Model -base; |
|
| 2 |
+use DBIx::Custom::Model -base; |
|
| 3 | 3 |
|
| 4 | 4 |
1; |
| ... | ... |
@@ -3,7 +3,7 @@ package MyDBI1; |
| 3 | 3 |
use strict; |
| 4 | 4 |
use warnings; |
| 5 | 5 |
|
| 6 |
-use base 'DBIx::Custom::Next'; |
|
| 6 |
+use base 'DBIx::Custom'; |
|
| 7 | 7 |
|
| 8 | 8 |
sub connect {
|
| 9 | 9 |
my $self = shift->SUPER::connect(@_); |
| ... | ... |
@@ -1,6 +1,6 @@ |
| 1 | 1 |
package MyModel1::TABLE1; |
| 2 | 2 |
|
| 3 |
-use DBIx::Custom::Next::Model -base; |
|
| 3 |
+use DBIx::Custom::Model -base; |
|
| 4 | 4 |
|
| 5 | 5 |
sub insert {
|
| 6 | 6 |
my ($self, $param) = @_; |
| ... | ... |
@@ -3,7 +3,7 @@ package MyModel1::TABLE2; |
| 3 | 3 |
use strict; |
| 4 | 4 |
use warnings; |
| 5 | 5 |
|
| 6 |
-use base 'DBIx::Custom::Next::Model'; |
|
| 6 |
+use base 'DBIx::Custom::Model'; |
|
| 7 | 7 |
|
| 8 | 8 |
|
| 9 | 9 |
sub insert {
|
| ... | ... |
@@ -1,5 +1,5 @@ |
| 1 | 1 |
package MyModel4; |
| 2 | 2 |
|
| 3 |
-use base 'DBIx::Custom::Next::Model'; |
|
| 3 |
+use base 'DBIx::Custom::Model'; |
|
| 4 | 4 |
|
| 5 | 5 |
1; |
| ... | ... |
@@ -1,5 +1,5 @@ |
| 1 | 1 |
package MyModel5; |
| 2 | 2 |
|
| 3 |
-use base 'DBIx::Custom::Next::Model'; |
|
| 3 |
+use base 'DBIx::Custom::Model'; |
|
| 4 | 4 |
|
| 5 | 5 |
1; |
| ... | ... |
@@ -1,5 +1,5 @@ |
| 1 | 1 |
package MyModel6; |
| 2 | 2 |
|
| 3 |
-use base 'DBIx::Custom::Next::Model'; |
|
| 3 |
+use base 'DBIx::Custom::Model'; |
|
| 4 | 4 |
|
| 5 | 5 |
1; |
| ... | ... |
@@ -1,5 +1,5 @@ |
| 1 | 1 |
package MyModel7; |
| 2 | 2 |
|
| 3 |
-use base 'DBIx::Custom::Next::Model'; |
|
| 3 |
+use base 'DBIx::Custom::Model'; |
|
| 4 | 4 |
|
| 5 | 5 |
1; |
| ... | ... |
@@ -1,4 +1,4 @@ |
| 1 | 1 |
package MyModel8; |
| 2 |
-use DBIx::Custom::Next::Model -base; |
|
| 2 |
+use DBIx::Custom::Model -base; |
|
| 3 | 3 |
|
| 4 | 4 |
1; |
| ... | ... |
@@ -4,7 +4,7 @@ use warnings; |
| 4 | 4 |
use utf8; |
| 5 | 5 |
|
| 6 | 6 |
use FindBin; |
| 7 |
-use DBIx::Custom::Next; |
|
| 7 |
+use DBIx::Custom; |
|
| 8 | 8 |
|
| 9 | 9 |
my $dbi; |
| 10 | 10 |
my $dsn; |
| ... | ... |
@@ -17,7 +17,7 @@ $dsn = "dbi:mysql:database=$database"; |
| 17 | 17 |
$args = {dsn => $dsn, user => $user, password => $password,};
|
| 18 | 18 |
|
| 19 | 19 |
plan skip_all => 'mysql private test' unless -f "$FindBin::Bin/run/mysql2.run" |
| 20 |
- && eval { $dbi = DBIx::Custom::Next->connect($args); 1 };
|
|
| 20 |
+ && eval { $dbi = DBIx::Custom->connect($args); 1 };
|
|
| 21 | 21 |
plan 'no_plan'; |
| 22 | 22 |
|
| 23 | 23 |
$SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /DEPRECATED/};
|
| ... | ... |
@@ -36,7 +36,7 @@ my $model; |
| 36 | 36 |
|
| 37 | 37 |
test 'connect'; |
| 38 | 38 |
eval {
|
| 39 |
- $dbi = DBIx::Custom::Next->connect( |
|
| 39 |
+ $dbi = DBIx::Custom->connect( |
|
| 40 | 40 |
dsn => "dbi:mysql:database=$database;host=localhost;port=10000", |
| 41 | 41 |
user => $user, |
| 42 | 42 |
password => $password |
| ... | ... |
@@ -109,7 +109,7 @@ is_deeply($row, {key1 => 1, key2 => 3}, "basic");
|
| 109 | 109 |
|
| 110 | 110 |
# Test memory leaks |
| 111 | 111 |
for (1 .. 300) {
|
| 112 |
- $dbi = DBIx::Custom::Next->connect( |
|
| 112 |
+ $dbi = DBIx::Custom->connect( |
|
| 113 | 113 |
dsn => "dbi:mysql:database=$database;host=localhost;port=10000", |
| 114 | 114 |
user => $user, |
| 115 | 115 |
password => $password |
| ... | ... |
@@ -124,15 +124,15 @@ test 'dbh'; |
| 124 | 124 |
"dbi:mysql:database=$database", |
| 125 | 125 |
$user, |
| 126 | 126 |
$password, |
| 127 |
- DBIx::Custom::Next->new->default_option |
|
| 127 |
+ DBIx::Custom->new->default_option |
|
| 128 | 128 |
); |
| 129 | 129 |
|
| 130 |
- my $dbi = DBIx::Custom::Next->connect(connector => $connector); |
|
| 130 |
+ my $dbi = DBIx::Custom->connect(connector => $connector); |
|
| 131 | 131 |
$dbi->delete_all(table => 'table1'); |
| 132 | 132 |
$dbi->do('insert into table1 (key1, key2) values (1, 2)');
|
| 133 | 133 |
is($dbi->select(table => 'table1')->fetch_hash_first->{key1}, 1);
|
| 134 | 134 |
|
| 135 |
- $dbi = DBIx::Custom::Next->new; |
|
| 135 |
+ $dbi = DBIx::Custom->new; |
|
| 136 | 136 |
$dbi->dbh('a');
|
| 137 | 137 |
is($dbi->{dbh}, 'a');
|
| 138 | 138 |
} |
| ... | ... |
@@ -144,10 +144,10 @@ test 'dbh'; |
| 144 | 144 |
"dbi:mysql:database=$database", |
| 145 | 145 |
$user, |
| 146 | 146 |
$password, |
| 147 |
- DBIx::Custom::Next->new->default_option |
|
| 147 |
+ DBIx::Custom->new->default_option |
|
| 148 | 148 |
); |
| 149 | 149 |
|
| 150 |
- my $dbi = DBIx::Custom::Next->connect(connector => $connector); |
|
| 150 |
+ my $dbi = DBIx::Custom->connect(connector => $connector); |
|
| 151 | 151 |
$dbi->delete_all(table => 'table1'); |
| 152 | 152 |
|
| 153 | 153 |
$dbi->connector->txn(sub {
|
| ... | ... |
@@ -169,10 +169,10 @@ test 'dbh'; |
| 169 | 169 |
[]); |
| 170 | 170 |
} |
| 171 | 171 |
|
| 172 |
-use DBIx::Custom::Next; |
|
| 172 |
+use DBIx::Custom; |
|
| 173 | 173 |
use Scalar::Util 'blessed'; |
| 174 | 174 |
{
|
| 175 |
- my $dbi = DBIx::Custom::Next->connect( |
|
| 175 |
+ my $dbi = DBIx::Custom->connect( |
|
| 176 | 176 |
user => $user, |
| 177 | 177 |
password => $password, |
| 178 | 178 |
dsn => "dbi:mysql:dbname=$database" |
| ... | ... |
@@ -186,7 +186,7 @@ use Scalar::Util 'blessed'; |
| 186 | 186 |
} |
| 187 | 187 |
|
| 188 | 188 |
{
|
| 189 |
- my $dbi = DBIx::Custom::Next->connect( |
|
| 189 |
+ my $dbi = DBIx::Custom->connect( |
|
| 190 | 190 |
user => $user, |
| 191 | 191 |
password => $password, |
| 192 | 192 |
dsn => "dbi:mysql:dbname=$database", |
| ... | ... |
@@ -203,10 +203,10 @@ test 'fork'; |
| 203 | 203 |
"dbi:mysql:database=$database", |
| 204 | 204 |
$user, |
| 205 | 205 |
$password, |
| 206 |
- DBIx::Custom::Next->new->default_option |
|
| 206 |
+ DBIx::Custom->new->default_option |
|
| 207 | 207 |
); |
| 208 | 208 |
|
| 209 |
- my $dbi = DBIx::Custom::Next->new(connector => $connector); |
|
| 209 |
+ my $dbi = DBIx::Custom->new(connector => $connector); |
|
| 210 | 210 |
$dbi->delete_all(table => 'table1'); |
| 211 | 211 |
$dbi->insert({key1 => 1, key2 => 2}, table => 'table1');
|
| 212 | 212 |
die "Can't fork" unless defined (my $pid = fork); |
| ... | ... |
@@ -4,7 +4,7 @@ use warnings; |
| 4 | 4 |
use utf8; |
| 5 | 5 |
|
| 6 | 6 |
use FindBin; |
| 7 |
-use DBIx::Custom::Next; |
|
| 7 |
+use DBIx::Custom; |
|
| 8 | 8 |
|
| 9 | 9 |
my $dbi; |
| 10 | 10 |
my $dsn; |
| ... | ... |
@@ -17,7 +17,7 @@ $dsn = "dbi:mysql:database=$database"; |
| 17 | 17 |
$args = {dsn => $dsn, user => $user, password => $password,};
|
| 18 | 18 |
|
| 19 | 19 |
plan skip_all => 'mysql private test' unless -f "$FindBin::Bin/run/mysql2.run" |
| 20 |
- && eval { $dbi = DBIx::Custom::Next->connect($args); 1 };
|
|
| 20 |
+ && eval { $dbi = DBIx::Custom->connect($args); 1 };
|
|
| 21 | 21 |
plan 'no_plan'; |
| 22 | 22 |
|
| 23 | 23 |
$SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /DEPRECATED/};
|
| ... | ... |
@@ -33,7 +33,7 @@ my $dbname; |
| 33 | 33 |
my $rows; |
| 34 | 34 |
my $result; |
| 35 | 35 |
|
| 36 |
-$dbi = DBIx::Custom::Next->connect( |
|
| 36 |
+$dbi = DBIx::Custom->connect( |
|
| 37 | 37 |
dsn => "dbi:mysql:database=$database", |
| 38 | 38 |
user => $user, |
| 39 | 39 |
password => $password |
| ... | ... |
@@ -43,7 +43,7 @@ $dbi->execute('create table table1 (key1 varchar(255), key2 varchar(255))');
|
| 43 | 43 |
|
| 44 | 44 |
test 'connector => 1'; |
| 45 | 45 |
{
|
| 46 |
- my $dbi = DBIx::Custom::Next->connect(dsn => $dsn, user => $user, password => $password, |
|
| 46 |
+ my $dbi = DBIx::Custom->connect(dsn => $dsn, user => $user, password => $password, |
|
| 47 | 47 |
option => {PrintError => 1}, connector => 1);
|
| 48 | 48 |
is(ref $dbi->connector, 'DBIx::Connector'); |
| 49 | 49 |
ok($dbi->dbh->{PrintError});
|
| ... | ... |
@@ -1,7 +1,7 @@ |
| 1 | 1 |
# Change quote for tests |
| 2 |
-use DBIx::Custom::Next; |
|
| 2 |
+use DBIx::Custom; |
|
| 3 | 3 |
{
|
| 4 |
- package DBIx::Custom::Next; |
|
| 4 |
+ package DBIx::Custom; |
|
| 5 | 5 |
no warnings 'redefine'; |
| 6 | 6 |
sub quote { '""' }
|
| 7 | 7 |
} |
| ... | ... |
@@ -13,15 +13,15 @@ BEGIN {
|
| 13 | 13 |
or plan skip_all => 'DBD::SQLite >= 1.25 required'; |
| 14 | 14 |
|
| 15 | 15 |
plan 'no_plan'; |
| 16 |
- use_ok('DBIx::Custom::Next');
|
|
| 16 |
+ use_ok('DBIx::Custom');
|
|
| 17 | 17 |
} |
| 18 | 18 |
|
| 19 | 19 |
$SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /DEPRECATED/};
|
| 20 | 20 |
sub test { print "# $_[0]\n" }
|
| 21 | 21 |
|
| 22 |
-use DBIx::Custom::Next; |
|
| 22 |
+use DBIx::Custom; |
|
| 23 | 23 |
{
|
| 24 |
- package DBIx::Custom::Next; |
|
| 24 |
+ package DBIx::Custom; |
|
| 25 | 25 |
has dsn => sub { 'dbi:SQLite:dbname=:memory:' }
|
| 26 | 26 |
} |
| 27 | 27 |
|
| ... | ... |
@@ -40,17 +40,17 @@ my $binary; |
| 40 | 40 |
my $model; |
| 41 | 41 |
|
| 42 | 42 |
# Prepare table |
| 43 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 43 |
+$dbi = DBIx::Custom->connect; |
|
| 44 | 44 |
|
| 45 | 45 |
|
| 46 | 46 |
### SQLite only test |
| 47 | 47 |
test 'option default'; |
| 48 |
-$dbi = DBIx::Custom::Next->new; |
|
| 48 |
+$dbi = DBIx::Custom->new; |
|
| 49 | 49 |
is_deeply($dbi->option, {});
|
| 50 | 50 |
|
| 51 | 51 |
|
| 52 | 52 |
test 'prefix'; |
| 53 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 53 |
+$dbi = DBIx::Custom->connect; |
|
| 54 | 54 |
eval { $dbi->execute('drop table table1') };
|
| 55 | 55 |
$dbi->execute('create table table1 (key1 varchar, key2 varchar, primary key(key1));');
|
| 56 | 56 |
$dbi->insert({key1 => 1, key2 => 2}, table => 'table1');
|
| ... | ... |
@@ -61,7 +61,7 @@ is_deeply($rows, [{key1 => 1, key2 => 4}], "basic");
|
| 61 | 61 |
|
| 62 | 62 |
|
| 63 | 63 |
test 'insert created_at and updated_at scalar reference'; |
| 64 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 64 |
+$dbi = DBIx::Custom->connect; |
|
| 65 | 65 |
eval { $dbi->execute('drop table table1') };
|
| 66 | 66 |
$dbi->execute('create table table1 (key1, key2, key3)');
|
| 67 | 67 |
$dbi->now(\"datetime('now')");
|
| ... | ... |
@@ -71,7 +71,7 @@ $row = $result->one; |
| 71 | 71 |
is($row->{key1}, $row->{key2});
|
| 72 | 72 |
is($row->{key1}, $row->{key3});
|
| 73 | 73 |
|
| 74 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 74 |
+$dbi = DBIx::Custom->connect; |
|
| 75 | 75 |
eval { $dbi->execute('drop table table1') };
|
| 76 | 76 |
$dbi->execute('create table table1 (key1, key2, key3)');
|
| 77 | 77 |
$dbi->now(\"datetime('now')");
|
| ... | ... |
@@ -83,7 +83,7 @@ is($row->{key1}, $row->{key2});
|
| 83 | 83 |
is($row->{key1}, $row->{key3});
|
| 84 | 84 |
|
| 85 | 85 |
test 'insert created_at and updated_at scalar reference'; |
| 86 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 86 |
+$dbi = DBIx::Custom->connect; |
|
| 87 | 87 |
eval { $dbi->execute('drop table table1') };
|
| 88 | 88 |
$dbi->execute('create table table1 (key1, key2, key3)');
|
| 89 | 89 |
$dbi->now(\"datetime('now')");
|
| ... | ... |
@@ -94,7 +94,7 @@ is($row->{key1}, $row->{key2});
|
| 94 | 94 |
is($row->{key1}, $row->{key3});
|
| 95 | 95 |
|
| 96 | 96 |
test 'update updated_at scalar reference'; |
| 97 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 97 |
+$dbi = DBIx::Custom->connect; |
|
| 98 | 98 |
eval { $dbi->execute('drop table table1') };
|
| 99 | 99 |
$dbi->execute('create table table1 (key1, key2)');
|
| 100 | 100 |
$dbi->now(\"datetime('now')");
|
| ... | ... |
@@ -115,7 +115,7 @@ $row = $result->one; |
| 115 | 115 |
is($row->{key1}, $row->{key2});
|
| 116 | 116 |
is($row->{key1}, $row->{key3});
|
| 117 | 117 |
|
| 118 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 118 |
+$dbi = DBIx::Custom->connect; |
|
| 119 | 119 |
eval { $dbi->execute('drop table table1') };
|
| 120 | 120 |
$dbi->execute('create table table1 (key1, key2)');
|
| 121 | 121 |
$dbi->now(\"datetime('now')");
|
| ... | ... |
@@ -128,7 +128,7 @@ is($row->{key1}, $row->{key2});
|
| 128 | 128 |
test 'DBIX_CUSTOM_DEBUG ok'; |
| 129 | 129 |
{
|
| 130 | 130 |
local $ENV{DBIX_CUSTOM_DEBUG} = 1;
|
| 131 |
- $dbi = DBIx::Custom::Next->connect; |
|
| 131 |
+ $dbi = DBIx::Custom->connect; |
|
| 132 | 132 |
eval { $dbi->execute('drop table table1') };
|
| 133 | 133 |
my $error; |
| 134 | 134 |
local $SIG{__WARN__} = sub {
|
| ... | ... |
@@ -139,7 +139,7 @@ test 'DBIX_CUSTOM_DEBUG ok'; |
| 139 | 139 |
} |
| 140 | 140 |
|
| 141 | 141 |
test 'quote'; |
| 142 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 142 |
+$dbi = DBIx::Custom->connect; |
|
| 143 | 143 |
$dbi->quote('"');
|
| 144 | 144 |
eval { $dbi->execute("drop table ${q}table$p") };
|
| 145 | 145 |
$dbi->execute($create_table_quote); |
| ... | ... |
@@ -150,7 +150,7 @@ $rows = $result->all; |
| 150 | 150 |
is_deeply($rows, [], "quote"); |
| 151 | 151 |
|
| 152 | 152 |
test 'finish statement handle'; |
| 153 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 153 |
+$dbi = DBIx::Custom->connect; |
|
| 154 | 154 |
$dbi->execute($create_table1); |
| 155 | 155 |
$dbi->insert({key1 => 1, key2 => 2}, table => 'table1');
|
| 156 | 156 |
$dbi->insert({key1 => 3, key2 => 4}, table => 'table1');
|
| ... | ... |
@@ -172,7 +172,7 @@ $result = $dbi->select(table => 'table2'); |
| 172 | 172 |
$row = $result->fetch_hash_first; |
| 173 | 173 |
ok(!$row, "no row fetch"); |
| 174 | 174 |
|
| 175 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 175 |
+$dbi = DBIx::Custom->connect; |
|
| 176 | 176 |
eval { $dbi->execute('drop table table1') };
|
| 177 | 177 |
$dbi->execute($create_table1); |
| 178 | 178 |
$dbi->insert({key1 => 1, key2 => 2}, table => 'table1');
|
| ... | ... |
@@ -214,7 +214,7 @@ like($@, qr/Row count must be specified/, "Not specified row count"); |
| 214 | 214 |
|
| 215 | 215 |
test 'bind_type option'; |
| 216 | 216 |
$binary = pack("I3", 1, 2, 3);
|
| 217 |
-$dbi = DBIx::Custom::Next->connect(option => {sqlite_unicode => 1});
|
|
| 217 |
+$dbi = DBIx::Custom->connect(option => {sqlite_unicode => 1});
|
|
| 218 | 218 |
$dbi->execute('create table table1(key1, key2)');
|
| 219 | 219 |
$dbi->insert({key1 => $binary, key2 => 'あ'}, table => 'table1', bind_type => [key1 => DBI::SQL_BLOB]);
|
| 220 | 220 |
$result = $dbi->select(table => 'table1'); |
| ... | ... |
@@ -225,7 +225,7 @@ $row = $result->one; |
| 225 | 225 |
is($row->{key1_length}, length $binary);
|
| 226 | 226 |
|
| 227 | 227 |
test 'type_rule from'; |
| 228 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 228 |
+$dbi = DBIx::Custom->connect; |
|
| 229 | 229 |
$dbi->type_rule( |
| 230 | 230 |
from1 => {
|
| 231 | 231 |
date => sub { uc $_[0] }
|
| ... | ... |
@@ -251,7 +251,7 @@ is_deeply($rows, [{key1 => 3, key2 => 4}], "append statement");
|
| 251 | 251 |
|
| 252 | 252 |
# DEPRECATED! test |
| 253 | 253 |
test 'filter __ expression'; |
| 254 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 254 |
+$dbi = DBIx::Custom->connect; |
|
| 255 | 255 |
eval { $dbi->execute('drop table table2') };
|
| 256 | 256 |
eval { $dbi->execute('drop table table3') };
|
| 257 | 257 |
$dbi->execute('create table table2 (id, name, table3_id)');
|
| ... | ... |
@@ -282,7 +282,7 @@ $result = $dbi->select( |
| 282 | 282 |
is($result->fetch_first->[0], 'b'); |
| 283 | 283 |
|
| 284 | 284 |
test 'quote'; |
| 285 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 285 |
+$dbi = DBIx::Custom->connect; |
|
| 286 | 286 |
eval { $dbi->execute("drop table ${q}table$p") };
|
| 287 | 287 |
$dbi->quote('"');
|
| 288 | 288 |
$dbi->execute($create_table_quote); |
| ... | ... |
@@ -293,7 +293,7 @@ $rows = $result->all; |
| 293 | 293 |
is_deeply($rows, [{select => 1, update => 2}]);
|
| 294 | 294 |
|
| 295 | 295 |
test 'join function'; |
| 296 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 296 |
+$dbi = DBIx::Custom->connect; |
|
| 297 | 297 |
eval { $dbi->execute("drop table table1") };
|
| 298 | 298 |
eval { $dbi->execute("drop table table2") };
|
| 299 | 299 |
$dbi->execute($create_table1); |
| ... | ... |
@@ -310,7 +310,7 @@ $result = $dbi->select( |
| 310 | 310 |
); |
| 311 | 311 |
is_deeply($result->all, [{"table2.key3" => 4}]);
|
| 312 | 312 |
|
| 313 |
-$dbi = DBIx::Custom::Next->connect; |
|
| 313 |
+$dbi = DBIx::Custom->connect; |
|
| 314 | 314 |
eval { $dbi->execute("drop table table1") };
|
| 315 | 315 |
eval { $dbi->execute("drop table table2") };
|
| 316 | 316 |
$dbi->execute($create_table1); |