Showing 4 changed files with 192 additions and 9 deletions
+40 -9
t/common-mysql.t
... ...
@@ -9,6 +9,37 @@ $ENV{DBIX_CUSTOM_SKIP_MESSAGE} = 'mysql private test';
9 9
 use DBIx::Custom;
10 10
 {
11 11
     package DBIx::Custom;
12
+    no warnings 'redefine';
13
+
14
+    my $table1 = 'table1';
15
+    my $table2 = 'table2';
16
+    my $table2_alias = 'table2_alias';
17
+    my $table3 = 'table3';
18
+    my $key1 = 'key1';
19
+    my $key2 = 'key2';
20
+    my $key3 = 'key3';
21
+    my $key4 = 'key4';
22
+    my $key5 = 'key5';
23
+    my $key6 = 'key6';
24
+    my $key7 = 'key7';
25
+    my $key8 = 'key8';
26
+    my $key9 = 'key9';
27
+    my $key10 = 'key10';
28
+
29
+    has table1 => $table1;
30
+    has table2 => $table2;
31
+    has table2_alias => $table2_alias;
32
+    has table3 => $table3;
33
+    has key1 => $key1;
34
+    has key2 => $key2;
35
+    has key3 => $key3;
36
+    has key4 => $key4;
37
+    has key5 => $key5;
38
+    has key6 => $key6;
39
+    has key7 => $key7;
40
+    has key8 => $key8;
41
+    has key9 => $key9;
42
+    has key10 => $key10;
12 43
 
13 44
     my $date_typename = 'Date';
14 45
     my $datetime_typename = 'Datetime';
... ...
@@ -27,15 +58,15 @@ use DBIx::Custom;
27 58
     has user => 'dbix_custom';
28 59
     has password => 'dbix_custom';
29 60
     
30
-    sub create_table1 { 'create table table1 (key1 varchar(255), key2 varchar(255)) engine=InnoDB;' }
31
-    sub create_table1_2 {'create table table1 (key1 varchar(255), key2 varchar(255), '
32
-     . 'key3 varchar(255), key4 varchar(255), key5 varchar(255)) engine=InnoDB;' }
33
-    sub create_table1_type { "create table table1 (key1 $date_typename, key2 $datetime_typename) engine=InnoDB;" }
34
-    sub create_table1_highperformance { "create table table1 (ab varchar(255), bc varchar(255), "
35
-      . "ik varchar(255), hi varchar(255), ui varchar(255), pq varchar(255), dc varchar(255)) engine=InnoDB;" }
36
-    sub create_table2 { 'create table table2 (key1 varchar(255), key3 varchar(255)) engine=InnoDB;' }
37
-    sub create_table2_2 { "create table table2 (key1 varchar(255), key2 varchar(255), key3 varchar(255)) engine=InnoDB" }
38
-    sub create_table3 { "create table table3 (key1 varchar(255), key2 varchar(255), key3 varchar(255)) engine=InnoDB" }
61
+    sub create_table1 { "create table $table1 ($key1 varchar(255), $key2 varchar(255)) engine=InnoDB;" }
62
+    sub create_table1_2 { "create table $table1 ($key1 varchar(255), $key2 varchar(255), "
63
+     . "$key3 varchar(255), key4 varchar(255), key5 varchar(255)) engine=InnoDB;" }
64
+    sub create_table1_type { "create table $table1 ($key1 $date_typename, $key2 $datetime_typename) engine=InnoDB;" }
65
+    sub create_table1_highperformance { "create table $table1 ($key1 varchar(255), $key2 varchar(255), "
66
+      . "$key3 varchar(255), $key4 varchar(255), $key5 varchar(255), $key6 varchar(255), $key7 varchar(255)) engine=InnoDB;" }
67
+    sub create_table2 { "create table $table2 ($key1 varchar(255), $key3 varchar(255)) engine=InnoDB;" }
68
+    sub create_table2_2 { "create table $table2 ($key1 varchar(255), $key2 varchar(255), $key3 varchar(255)) engine=InnoDB" }
69
+    sub create_table3 { "create table $table3 ($key1 varchar(255), $key2 varchar(255), $key3 varchar(255)) engine=InnoDB" }
39 70
     sub create_table_reserved {
40 71
       'create table `table` (`select` varchar(255), `update` varchar(255)) engine=InnoDB' }
41 72
 }
+76
t/common-oracle.t_
... ...
@@ -0,0 +1,76 @@
1
+use strict;
2
+use warnings;
3
+
4
+use FindBin;
5
+$ENV{DBIX_CUSTOM_TEST_RUN} = 1
6
+  if -f "$FindBin::Bin/run/common-oracle.run";
7
+$ENV{DBIX_CUSTOM_SKIP_MESSAGE} = 'oracle private test';
8
+
9
+use DBIx::Custom;
10
+{
11
+    package DBIx::Custom;
12
+    no warnings 'redefine';
13
+
14
+    my $date_typename = 'CHAR(10)';
15
+    my $datetime_typename = 'DATE';
16
+
17
+    sub date_typename { lc 'CHAR' }
18
+    sub datetime_typename { lc $datetime_typename }
19
+
20
+    my $date_datatype = 91;
21
+    my $datetime_datatype = 11;
22
+
23
+    sub date_datatype { lc $date_datatype }
24
+    sub datetime_datatype { lc $datetime_datatype }
25
+    
26
+    has datetime_suffix => '';
27
+
28
+    has dsn => 'dbi:Oracle:host=localhost;port=1521;sid=XE';
29
+    has user  => 'dbix_custom';
30
+    has password => 'dbix_custom';
31
+    has exclude_table => sub {
32
+
33
+        return qr/^(
34
+            pg_|column_|role_|view_|sql_
35
+            |applicable_roles
36
+            |check_constraints
37
+            |columns
38
+            |constraint_column_usage
39
+            |constraint_table_usage
40
+            |data_type_privileges
41
+            |domain_constraints
42
+            |domain_udt_usage
43
+            |domains
44
+            |element_types
45
+            |enabled_roles
46
+            |information_schema
47
+            |information_schema_catalog_name
48
+            |key_column_usage
49
+            |parameters
50
+            |referential_constraints
51
+            |routine_privileges
52
+            |routines
53
+            |schemata
54
+            |table_constraints
55
+            |table_privileges
56
+            |tables
57
+            |triggered_update_columns
58
+            |triggers
59
+            |usage_privileges
60
+            |views
61
+        )/x
62
+    };
63
+    
64
+    sub create_table1 { 'create table table1 (key1 varchar2(255), key2 varchar2(255));' }
65
+    sub create_table1_2 {'create table table1 (key1 varchar2(255), key2 varchar2(255), '
66
+     . 'key3 varchar2(255), key4 varchar2(255), key5 varchar2(255));' }
67
+    sub create_table1_type { "create table table1 (key1 $date_typename, key2 $datetime_typename);" }
68
+    sub create_table1_highperformance { "create table table1 (ab varchar2(255), bc varchar2(255), "
69
+      . "ik varchar2(255), hi varchar2(255), ui varchar2(255), pq varchar2(255), dc varchar2(255));" }
70
+    sub create_table2 { 'create table table2 (key1 varchar2(255), key3 varchar2(255));' }
71
+    sub create_table2_2 { "create table table2 (key1 varchar2(255), key2 varchar2(255), key3 varchar2(255))" }
72
+    sub create_table3 { "create table table3 (key1 varchar2(255), key2 varchar2(255), key3 varchar2(255))" }
73
+    sub create_table_reserved { 'create table "table" ("select" varchar2(255), "update" varchar2(255))' }
74
+}
75
+
76
+require "$FindBin::Bin/common.t";
+74
t/common-postgresql.t_
... ...
@@ -0,0 +1,74 @@
1
+use strict;
2
+use warnings;
3
+
4
+use FindBin;
5
+$ENV{DBIX_CUSTOM_TEST_RUN} = 1
6
+  if -f "$FindBin::Bin/run/common-postgresql.run";
7
+$ENV{DBIX_CUSTOM_SKIP_MESSAGE} = 'postgresql private test';
8
+
9
+use DBIx::Custom;
10
+{
11
+    package DBIx::Custom;
12
+    no warnings 'redefine';
13
+
14
+    my $date_typename = 'Date';
15
+    my $datetime_typename = 'Timestamp';
16
+
17
+    sub date_typename { lc $date_typename }
18
+    sub datetime_typename { 'timestamp without time zone' }
19
+
20
+    my $date_datatype = 91;
21
+    my $datetime_datatype = 11;
22
+
23
+    sub date_datatype { lc $date_datatype }
24
+    sub datetime_datatype { lc $datetime_datatype }
25
+
26
+    has dsn => "dbi:Pg:dbname=dbix_custom";
27
+    has user  => 'dbix_custom';
28
+    has password => 'dbix_custom';
29
+    has exclude_table => sub {
30
+
31
+        return qr/^(
32
+            pg_|column_|role_|view_|sql_
33
+            |applicable_roles
34
+            |check_constraints
35
+            |columns
36
+            |constraint_column_usage
37
+            |constraint_table_usage
38
+            |data_type_privileges
39
+            |domain_constraints
40
+            |domain_udt_usage
41
+            |domains
42
+            |element_types
43
+            |enabled_roles
44
+            |information_schema
45
+            |information_schema_catalog_name
46
+            |key_column_usage
47
+            |parameters
48
+            |referential_constraints
49
+            |routine_privileges
50
+            |routines
51
+            |schemata
52
+            |table_constraints
53
+            |table_privileges
54
+            |tables
55
+            |triggered_update_columns
56
+            |triggers
57
+            |usage_privileges
58
+            |views
59
+        )/x
60
+    };
61
+    
62
+    sub create_table1 { 'create table table1 (key1 varchar(255), key2 varchar(255));' }
63
+    sub create_table1_2 {'create table table1 (key1 varchar(255), key2 varchar(255), '
64
+     . 'key3 varchar(255), key4 varchar(255), key5 varchar(255));' }
65
+    sub create_table1_type { "create table table1 (key1 $date_typename, key2 $datetime_typename);" }
66
+    sub create_table1_highperformance { "create table table1 (ab varchar(255), bc varchar(255), "
67
+      . "ik varchar(255), hi varchar(255), ui varchar(255), pq varchar(255), dc varchar(255));" }
68
+    sub create_table2 { 'create table table2 (key1 varchar(255), key3 varchar(255));' }
69
+    sub create_table2_2 { "create table table2 (key1 varchar(255), key2 varchar(255), key3 varchar(255))" }
70
+    sub create_table3 { "create table table3 (key1 varchar(255), key2 varchar(255), key3 varchar(255))" }
71
+    sub create_table_reserved { 'create table "table" ("select" varchar(255), "update" varchar(255))' }
72
+}
73
+
74
+require "$FindBin::Bin/common.t";
+2
t/common-sqlite.t
... ...
@@ -4,6 +4,8 @@ use warnings;
4 4
 use FindBin;
5 5
 $ENV{DBIX_CUSTOM_TEST_RUN} = 1;
6 6
 
7
+
8
+
7 9
 use DBIx::Custom;
8 10
 {
9 11
     package DBIx::Custom;