Showing 20 changed files with 0 additions and 188 deletions
-19
t/basic/MyDBI1.pm
... ...
@@ -1,19 +0,0 @@
1
-package MyDBI1;
2
-
3
-use strict;
4
-use warnings;
5
-
6
-use base 'DBIx::Custom';
7
-
8
-sub connect {
9
-    my $self = shift->SUPER::connect(@_);
10
-    
11
-    $self->include_model(
12
-        MyModel1 => [
13
-            'book',
14
-            {class => 'Company', name => 'company'}
15
-        ]
16
-    );
17
-}
18
-
19
-1;
-17
t/basic/MyModel1/Company.pm
... ...
@@ -1,17 +0,0 @@
1
-package MyModel1::Company;
2
-
3
-use strict;
4
-use warnings;
5
-
6
-use base 'DBIx::Custom::Model';
7
-
8
-
9
-sub insert {
10
-    my ($self, $param) = @_;
11
-    
12
-    return $self->SUPER::insert(param => $param);
13
-}
14
-
15
-sub list { shift->select; }
16
-
17
-1;
-13
t/basic/MyModel1/book.pm
... ...
@@ -1,13 +0,0 @@
1
-package MyModel1::book;
2
-
3
-use DBIx::Custom::Model -base;
4
-
5
-sub insert {
6
-    my ($self, $param) = @_;
7
-    
8
-    return $self->SUPER::insert(param => $param);
9
-}
10
-
11
-sub list { shift->select; }
12
-
13
-1;
-5
t/basic/MyModel4.pm
... ...
@@ -1,5 +0,0 @@
1
-package MyModel4;
2
-
3
-use base 'DBIx::Custom::Model';
4
-
5
-1;
-9
t/basic/MyModel4/book.pm
... ...
@@ -1,9 +0,0 @@
1
-package MyModel4::book;
2
-
3
-use base 'MyModel4';
4
-
5
-sub table { 'table1' }
6
-
7
-sub list { shift->select }
8
-
9
-1;
-8
t/basic/MyModel4/company.pm
... ...
@@ -1,8 +0,0 @@
1
-package MyModel4::company;
2
-
3
-use base 'MyModel4';
4
-
5
-sub insert { shift->SUPER::insert(param => $_[0]) }
6
-sub list { shift->select }
7
-
8
-1;
-5
t/basic/MyModel5.pm
... ...
@@ -1,5 +0,0 @@
1
-package MyModel5;
2
-
3
-use base 'DBIx::Custom::Model';
4
-
5
-1;
-7
t/basic/MyModel5/table1.pm
... ...
@@ -1,7 +0,0 @@
1
-package MyModel5::table1;
2
-
3
-use MyModel5 -base;
4
-
5
-has primary_key => sub { ['key1', 'key2'] };
6
-
7
-1;
-12
t/basic/MyModel5/table1_1.pm
... ...
@@ -1,12 +0,0 @@
1
-package MyModel5::table1_1;
2
-
3
-use strict;
4
-use warnings;
5
-
6
-use base 'MyModel5';
7
-
8
-__PACKAGE__->attr(table => 'table2');
9
-
10
-__PACKAGE__->attr('primary_key' => sub { ['key1', 'key2'] });
11
-
12
-1;
-13
t/basic/MyModel5/table1_2.pm
... ...
@@ -1,13 +0,0 @@
1
-package MyModel5::table1_2;
2
-
3
-use strict;
4
-use warnings;
5
-
6
-use base 'MyModel5';
7
-
8
-__PACKAGE__->attr(name => 'table1_3');
9
-__PACKAGE__->attr(table => 'table3');
10
-
11
-__PACKAGE__->attr('primary_key' => sub { ['key1', 'key2'] });
12
-
13
-1;
-5
t/basic/MyModel6.pm
... ...
@@ -1,5 +0,0 @@
1
-package MyModel6;
2
-
3
-use base 'DBIx::Custom::Model';
4
-
5
-1;
-14
t/basic/MyModel6/table1.pm
... ...
@@ -1,14 +0,0 @@
1
-package MyModel6::table1;
2
-
3
-use base 'MyModel6';
4
-
5
-__PACKAGE__->attr(
6
-    join => sub {
7
-        [
8
-            'left outer join table2 on table1.key1 = table2.key1'
9
-        ]
10
-    },
11
-    primary_key => sub { ['key1'] }
12
-);
13
-
14
-1;
-5
t/basic/MyModel6/table2.pm
... ...
@@ -1,5 +0,0 @@
1
-package MyModel6::table2;
2
-
3
-use base 'MyModel6';
4
-
5
-1;
-11
t/basic/MyModel6/table3.pm
... ...
@@ -1,11 +0,0 @@
1
-package MyModel6::table3;
2
-
3
-use base 'MyModel6';
4
-
5
-__PACKAGE__->attr(filter => sub {
6
-    [
7
-        key1 => {in => sub { uc $_[0] }}
8
-    ]
9
-});
10
-
11
-1;
-5
t/basic/MyModel7.pm
... ...
@@ -1,5 +0,0 @@
1
-package MyModel7;
2
-
3
-use base 'DBIx::Custom::Model';
4
-
5
-1;
-14
t/basic/MyModel7/table1.pm
... ...
@@ -1,14 +0,0 @@
1
-package MyModel7::table1;
2
-
3
-use base 'MyModel7';
4
-
5
-__PACKAGE__->attr(
6
-    primary_key => sub { ['key1'] },
7
-    join => sub {
8
-        [
9
-            'left outer join table2 on table1.key1 = table2.key1'
10
-        ]
11
-    },
12
-);
13
-
14
-1;
-5
t/basic/MyModel7/table2.pm
... ...
@@ -1,5 +0,0 @@
1
-package MyModel7::table2;
2
-
3
-use base 'MyModel7';
4
-
5
-1;
-4
t/basic/MyModel8.pm
... ...
@@ -1,4 +0,0 @@
1
-package MyModel8;
2
-use DBIx::Custom::Model -base;
3
-
4
-1;
-7
t/basic/MyModel8/table1.pm
... ...
@@ -1,7 +0,0 @@
1
-package MyModel8::table1;
2
-use MyModel8 -base;
3
-
4
-has join => sub { ['left join table2 as table2_alias on table1.key1 = table2_alias.key1'] };
5
-
6
-
7
-1;
-10
t/basic/MyModel8/table2.pm
... ...
@@ -1,10 +0,0 @@
1
-package MyModel8::table2;
2
-use MyModel8 -base;
3
-
4
-has filter => sub {
5
-    {
6
-        key3 => {out => sub { $_[0] * 2}, in => sub { $_[0] * 3}, end => sub { $_[0] * 4 }}
7
-    }
8
-};
9
-
10
-1;