db2 2.5.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. data/.gitignore +1 -0
  2. data/CHANGES +181 -0
  3. data/LICENSE +18 -0
  4. data/MANIFEST +14 -0
  5. data/ParameterizedQueries README +39 -0
  6. data/README +282 -0
  7. data/ext/Makefile.nt32 +181 -0
  8. data/ext/extconf.rb +66 -0
  9. data/ext/ibm_db.c +11166 -0
  10. data/ext/ruby_ibm_db.h +236 -0
  11. data/ext/ruby_ibm_db_cli.c +738 -0
  12. data/ext/ruby_ibm_db_cli.h +431 -0
  13. data/init.rb +42 -0
  14. data/lib/IBM_DB.rb +2 -0
  15. data/lib/active_record/connection_adapters/ibm_db_adapter.rb +2558 -0
  16. data/lib/active_record/connection_adapters/ibm_db_pstmt.rb +1965 -0
  17. data/lib/active_record/vendor/db2-i5-zOS.yaml +328 -0
  18. data/test/cases/adapter_test.rb +202 -0
  19. data/test/cases/associations/belongs_to_associations_test.rb +486 -0
  20. data/test/cases/associations/cascaded_eager_loading_test.rb +183 -0
  21. data/test/cases/associations/eager_test.rb +862 -0
  22. data/test/cases/associations/has_and_belongs_to_many_associations_test.rb +917 -0
  23. data/test/cases/associations/has_many_through_associations_test.rb +461 -0
  24. data/test/cases/associations/join_model_test.rb +793 -0
  25. data/test/cases/attribute_methods_test.rb +621 -0
  26. data/test/cases/base_test.rb +1486 -0
  27. data/test/cases/calculations_test.rb +362 -0
  28. data/test/cases/finder_test.rb +1088 -0
  29. data/test/cases/fixtures_test.rb +684 -0
  30. data/test/cases/migration_test.rb +2014 -0
  31. data/test/cases/schema_dumper_test.rb +232 -0
  32. data/test/cases/validations/uniqueness_validation_test.rb +283 -0
  33. data/test/connections/native_ibm_db/connection.rb +42 -0
  34. data/test/ibm_db_test.rb +25 -0
  35. data/test/models/warehouse_thing.rb +5 -0
  36. data/test/schema/i5/ibm_db_specific_schema.rb +135 -0
  37. data/test/schema/ids/ibm_db_specific_schema.rb +138 -0
  38. data/test/schema/luw/ibm_db_specific_schema.rb +135 -0
  39. data/test/schema/schema.rb +647 -0
  40. data/test/schema/zOS/ibm_db_specific_schema.rb +206 -0
  41. metadata +105 -0
@@ -0,0 +1,206 @@
1
+ ActiveRecord::Schema.define do
2
+
3
+ execute "DROP TABLE COMMENTS" rescue nil
4
+ execute "DROP TABLE POSTS" rescue nil
5
+ execute "DROP TABLE ITEMS" rescue nil
6
+ execute "DROP TABLE TOPICS" rescue nil
7
+ execute "DROP TABLE fk_test_has_fk" rescue nil
8
+ execute "DROP TABLE fk_test_has_pk" rescue nil
9
+ execute "DROP TABLE CIRCLES" rescue nil
10
+ execute "DROP TABLE SQUARES" rescue nil
11
+ execute "DROP TABLE TRIANGLES" rescue nil
12
+ execute "DROP TABLE NON_POLY_ONES" rescue nil
13
+ execute "DROP TABLE NON_POLY_TWOS" rescue nil
14
+ execute "DROP TABLE PAINT_COLORS" rescue nil
15
+ execute "DROP TABLE PAINT_TEXTURES" rescue nil
16
+
17
+ execute <<_SQL
18
+ CREATE TABLE comments (
19
+ id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100),
20
+ post_id INT NOT NULL,
21
+ type VARCHAR(255) DEFAULT NULL,
22
+ body VARCHAR(3000)NOT NULL,
23
+ PRIMARY KEY (id)
24
+ );
25
+ _SQL
26
+
27
+ execute <<_SQL
28
+ CREATE UNIQUE INDEX comments_id_idx ON comments(id);
29
+ _SQL
30
+
31
+ execute <<_SQL
32
+ CREATE TABLE posts (
33
+ id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100),
34
+ author_id INT DEFAULT NULL,
35
+ title VARCHAR(255) NOT NULL,
36
+ type VARCHAR(255) DEFAULT NULL,
37
+ body VARCHAR(3000) NOT NULL,
38
+ comments_count integer DEFAULT 0,
39
+ taggings_count integer DEFAULT 0,
40
+ PRIMARY KEY (id)
41
+ );
42
+
43
+ _SQL
44
+
45
+ execute <<_SQL
46
+ CREATE UNIQUE INDEX posts_id_idx ON posts(id);
47
+ _SQL
48
+
49
+ execute <<_SQL
50
+ CREATE TABLE fk_test_has_pk (
51
+ id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100),
52
+ PRIMARY KEY (id)
53
+ );
54
+ _SQL
55
+
56
+ execute <<_SQL
57
+ CREATE UNIQUE INDEX fk_has_pk_id_idx ON fk_test_has_pk(id);
58
+ _SQL
59
+
60
+ execute <<_SQL
61
+ CREATE TABLE fk_test_has_fk (
62
+ id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100),
63
+ fk_id integer NOT NULL,
64
+ PRIMARY KEY (id),
65
+ FOREIGN KEY (fk_id) REFERENCES fk_test_has_pk(id)
66
+ );
67
+ _SQL
68
+
69
+ execute <<_SQL
70
+ CREATE UNIQUE INDEX fk_has_fk_id_idx ON fk_test_has_fk(id);
71
+ _SQL
72
+
73
+ execute <<_SQL
74
+ CREATE TABLE items (
75
+ id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100),
76
+ name VARCHAR(255) DEFAULT NULL,
77
+ PRIMARY KEY (id)
78
+ );
79
+
80
+ _SQL
81
+
82
+ execute <<_SQL
83
+ CREATE UNIQUE INDEX items_id_idx ON items(id);
84
+ _SQL
85
+
86
+ execute <<_SQL
87
+ CREATE TABLE circles (
88
+ id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 1),
89
+ PRIMARY KEY (id)
90
+ );
91
+ _SQL
92
+
93
+ execute <<_SQL
94
+ CREATE UNIQUE INDEX circles_id_idx ON circles(id);
95
+ _SQL
96
+
97
+ execute <<_SQL
98
+ CREATE TABLE squares(
99
+ id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 1),
100
+ PRIMARY KEY (id)
101
+ );
102
+ _SQL
103
+
104
+ execute <<_SQL
105
+ CREATE UNIQUE INDEX squares_id_idx ON squares(id);
106
+ _SQL
107
+
108
+ execute <<_SQL
109
+ CREATE TABLE triangles(
110
+ id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 1),
111
+ PRIMARY KEY (id)
112
+ );
113
+ _SQL
114
+
115
+ execute <<_SQL
116
+ CREATE UNIQUE INDEX triangles_id_idx ON triangles(id);
117
+ _SQL
118
+
119
+ execute <<_SQL
120
+ CREATE TABLE non_poly_ones(
121
+ id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 1),
122
+ PRIMARY KEY (id)
123
+ );
124
+ _SQL
125
+
126
+ execute <<_SQL
127
+ CREATE UNIQUE INDEX non_poly_ones_id_idx ON non_poly_ones(id);
128
+ _SQL
129
+
130
+ execute <<_SQL
131
+ CREATE TABLE non_poly_twos(
132
+ id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 1),
133
+ PRIMARY KEY (id)
134
+ );
135
+ _SQL
136
+
137
+ execute <<_SQL
138
+ CREATE UNIQUE INDEX non_poly_twos_id_idx ON non_poly_twos(id);
139
+ _SQL
140
+
141
+ execute <<_SQL
142
+ CREATE TABLE paint_colors(
143
+ id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 1),
144
+ non_poly_one_id INT,
145
+ PRIMARY KEY (id)
146
+ );
147
+ _SQL
148
+
149
+ execute <<_SQL
150
+ CREATE UNIQUE INDEX paint_colors_id_idx ON paint_colors(id);
151
+ _SQL
152
+
153
+ execute <<_SQL
154
+ CREATE TABLE paint_textures(
155
+ id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 1),
156
+ non_poly_two_id INT,
157
+ PRIMARY KEY (id)
158
+ );
159
+ _SQL
160
+
161
+ execute <<_SQL
162
+ CREATE UNIQUE INDEX paint_textures_id_idx ON paint_textures(id);
163
+ _SQL
164
+
165
+ execute <<_SQL
166
+ CREATE TABLE topics (
167
+ id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 100),
168
+ title VARCHAR(255) DEFAULT NULL,
169
+ author_name VARCHAR(255) DEFAULT NULL,
170
+ author_email_address VARCHAR(255) DEFAULT NULL,
171
+ written_on TIMESTAMP DEFAULT NULL,
172
+ bonus_time TIME DEFAULT NULL,
173
+ last_read DATE DEFAULT NULL,
174
+ content VARCHAR(3000),
175
+ approved SMALLINT DEFAULT 1,
176
+ replies_count INT DEFAULT 0,
177
+ parent_id INT DEFAULT NULL,
178
+ parent_title VARCHAR(255) DEFAULT NULL,
179
+ type VARCHAR(50) DEFAULT NULL,
180
+ group VARCHAR(50) DEFAULT NULL,
181
+ PRIMARY KEY (id)
182
+ );
183
+
184
+ _SQL
185
+
186
+ execute <<_SQL
187
+ CREATE UNIQUE INDEX topics_id_idx ON topics(id);
188
+ _SQL
189
+
190
+ execute <<_SQL
191
+ CREATE UNIQUE INDEX movies_id_idx ON movies(movieid);
192
+ _SQL
193
+
194
+ execute <<_SQL
195
+ CREATE UNIQUE INDEX auto_id_tests_id_idx ON auto_id_tests(auto_id);
196
+ _SQL
197
+
198
+ execute <<_SQL
199
+ CREATE UNIQUE INDEX mixed_case_monkeys_id_idx ON mixed_case_monkeys(monkeyID);
200
+ _SQL
201
+
202
+ execute <<_SQL
203
+ CREATE UNIQUE INDEX keyboards_id_idx ON keyboards(key_number);
204
+ _SQL
205
+
206
+ end
metadata ADDED
@@ -0,0 +1,105 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: db2
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 2.5.6
6
+ platform: ruby
7
+ authors:
8
+ - IBM
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-02-08 00:00:00 -08:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: activerecord
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: 1.15.1
25
+ type: :runtime
26
+ version_requirements: *id001
27
+ description:
28
+ email: rubyibm-developers@rubyforge.org
29
+ executables: []
30
+
31
+ extensions:
32
+ - ext/extconf.rb
33
+ extra_rdoc_files: []
34
+
35
+ files:
36
+ - .gitignore
37
+ - CHANGES
38
+ - LICENSE
39
+ - MANIFEST
40
+ - ParameterizedQueries README
41
+ - README
42
+ - ext/Makefile.nt32
43
+ - ext/extconf.rb
44
+ - ext/ibm_db.c
45
+ - ext/ruby_ibm_db.h
46
+ - ext/ruby_ibm_db_cli.c
47
+ - ext/ruby_ibm_db_cli.h
48
+ - init.rb
49
+ - lib/IBM_DB.rb
50
+ - lib/active_record/connection_adapters/ibm_db_adapter.rb
51
+ - lib/active_record/connection_adapters/ibm_db_pstmt.rb
52
+ - lib/active_record/vendor/db2-i5-zOS.yaml
53
+ - test/cases/adapter_test.rb
54
+ - test/cases/associations/belongs_to_associations_test.rb
55
+ - test/cases/associations/cascaded_eager_loading_test.rb
56
+ - test/cases/associations/eager_test.rb
57
+ - test/cases/associations/has_and_belongs_to_many_associations_test.rb
58
+ - test/cases/associations/has_many_through_associations_test.rb
59
+ - test/cases/associations/join_model_test.rb
60
+ - test/cases/attribute_methods_test.rb
61
+ - test/cases/base_test.rb
62
+ - test/cases/calculations_test.rb
63
+ - test/cases/finder_test.rb
64
+ - test/cases/fixtures_test.rb
65
+ - test/cases/migration_test.rb
66
+ - test/cases/schema_dumper_test.rb
67
+ - test/cases/validations/uniqueness_validation_test.rb
68
+ - test/connections/native_ibm_db/connection.rb
69
+ - test/ibm_db_test.rb
70
+ - test/models/warehouse_thing.rb
71
+ - test/schema/i5/ibm_db_specific_schema.rb
72
+ - test/schema/ids/ibm_db_specific_schema.rb
73
+ - test/schema/luw/ibm_db_specific_schema.rb
74
+ - test/schema/schema.rb
75
+ - test/schema/zOS/ibm_db_specific_schema.rb
76
+ has_rdoc: true
77
+ homepage: http://rubyforge.org/projects/rubyibm/
78
+ licenses: []
79
+
80
+ post_install_message:
81
+ rdoc_options: []
82
+
83
+ require_paths:
84
+ - lib
85
+ required_ruby_version: !ruby/object:Gem::Requirement
86
+ none: false
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: 1.8.6
91
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
+ none: false
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: "0"
97
+ requirements:
98
+ - ActiveRecord, at least 1.15.1
99
+ rubyforge_project: rubyibm
100
+ rubygems_version: 1.6.2
101
+ signing_key:
102
+ specification_version: 3
103
+ summary: "Rails Driver and Adapter for IBM Data Servers: {DB2 on Linux/Unix/Windows, DB2 on zOS, DB2 on i5/OS, Informix (IDS)}"
104
+ test_files: []
105
+