activerecord-odbc-adapter 2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. data/AUTHORS +16 -0
  2. data/COPYING +21 -0
  3. data/ChangeLog +139 -0
  4. data/LICENSE +5 -0
  5. data/NEWS +25 -0
  6. data/README +229 -0
  7. data/lib/active_record/connection_adapters/odbc_adapter.rb +1950 -0
  8. data/lib/active_record/vendor/odbcext_db2.rb +87 -0
  9. data/lib/active_record/vendor/odbcext_informix.rb +144 -0
  10. data/lib/active_record/vendor/odbcext_informix_col.rb +45 -0
  11. data/lib/active_record/vendor/odbcext_ingres.rb +156 -0
  12. data/lib/active_record/vendor/odbcext_microsoftsqlserver.rb +216 -0
  13. data/lib/active_record/vendor/odbcext_microsoftsqlserver_col.rb +40 -0
  14. data/lib/active_record/vendor/odbcext_mysql.rb +174 -0
  15. data/lib/active_record/vendor/odbcext_oracle.rb +219 -0
  16. data/lib/active_record/vendor/odbcext_postgresql.rb +158 -0
  17. data/lib/active_record/vendor/odbcext_progress.rb +139 -0
  18. data/lib/active_record/vendor/odbcext_progress89.rb +259 -0
  19. data/lib/active_record/vendor/odbcext_sqlanywhere.rb +115 -0
  20. data/lib/active_record/vendor/odbcext_sqlanywhere_col.rb +49 -0
  21. data/lib/active_record/vendor/odbcext_sybase.rb +213 -0
  22. data/lib/active_record/vendor/odbcext_sybase_col.rb +49 -0
  23. data/lib/active_record/vendor/odbcext_virtuoso.rb +158 -0
  24. data/lib/odbc_adapter.rb +28 -0
  25. data/support/lib/active_record/connection_adapters/abstract/schema_definitions.rb +259 -0
  26. data/support/odbc_rails.diff +367 -0
  27. data/support/pack_odbc.rb +119 -0
  28. data/support/rake/rails_plugin_package_task.rb +212 -0
  29. data/support/rake_fixes/README +6 -0
  30. data/support/rake_fixes/databases.dif +13 -0
  31. data/support/test/base_test.rb +1765 -0
  32. data/support/test/migration_test.rb +1007 -0
  33. data/test/connections/native_odbc/connection.rb +137 -0
  34. data/test/fixtures/db_definitions/db2.drop.sql +33 -0
  35. data/test/fixtures/db_definitions/db2.sql +237 -0
  36. data/test/fixtures/db_definitions/db22.drop.sql +2 -0
  37. data/test/fixtures/db_definitions/db22.sql +5 -0
  38. data/test/fixtures/db_definitions/informix.drop.sql +33 -0
  39. data/test/fixtures/db_definitions/informix.sql +223 -0
  40. data/test/fixtures/db_definitions/informix2.drop.sql +2 -0
  41. data/test/fixtures/db_definitions/informix2.sql +5 -0
  42. data/test/fixtures/db_definitions/ingres.drop.sql +68 -0
  43. data/test/fixtures/db_definitions/ingres.sql +252 -0
  44. data/test/fixtures/db_definitions/ingres2.drop.sql +2 -0
  45. data/test/fixtures/db_definitions/ingres2.sql +5 -0
  46. data/test/fixtures/db_definitions/mysql.drop.sql +33 -0
  47. data/test/fixtures/db_definitions/mysql.sql +238 -0
  48. data/test/fixtures/db_definitions/mysql2.drop.sql +2 -0
  49. data/test/fixtures/db_definitions/mysql2.sql +5 -0
  50. data/test/fixtures/db_definitions/oracle_odbc.drop.sql +72 -0
  51. data/test/fixtures/db_definitions/oracle_odbc.sql +296 -0
  52. data/test/fixtures/db_definitions/oracle_odbc2.drop.sql +2 -0
  53. data/test/fixtures/db_definitions/oracle_odbc2.sql +6 -0
  54. data/test/fixtures/db_definitions/postgresql.drop.sql +38 -0
  55. data/test/fixtures/db_definitions/postgresql.sql +267 -0
  56. data/test/fixtures/db_definitions/postgresql2.drop.sql +2 -0
  57. data/test/fixtures/db_definitions/postgresql2.sql +5 -0
  58. data/test/fixtures/db_definitions/progress.drop.sql +67 -0
  59. data/test/fixtures/db_definitions/progress.sql +255 -0
  60. data/test/fixtures/db_definitions/progress2.drop.sql +2 -0
  61. data/test/fixtures/db_definitions/progress2.sql +6 -0
  62. data/test/fixtures/db_definitions/sqlserver.drop.sql +35 -0
  63. data/test/fixtures/db_definitions/sqlserver.sql +247 -0
  64. data/test/fixtures/db_definitions/sqlserver2.drop.sql +2 -0
  65. data/test/fixtures/db_definitions/sqlserver2.sql +5 -0
  66. data/test/fixtures/db_definitions/sybase.drop.sql +35 -0
  67. data/test/fixtures/db_definitions/sybase.sql +222 -0
  68. data/test/fixtures/db_definitions/sybase2.drop.sql +4 -0
  69. data/test/fixtures/db_definitions/sybase2.sql +5 -0
  70. data/test/fixtures/db_definitions/virtuoso.drop.sql +33 -0
  71. data/test/fixtures/db_definitions/virtuoso.sql +218 -0
  72. data/test/fixtures/db_definitions/virtuoso2.drop.sql +2 -0
  73. data/test/fixtures/db_definitions/virtuoso2.sql +5 -0
  74. metadata +166 -0
@@ -0,0 +1,4 @@
1
+ DROP TABLE courses
2
+ go
3
+
4
+
@@ -0,0 +1,5 @@
1
+ CREATE TABLE courses (
2
+ id int NOT NULL PRIMARY KEY,
3
+ name varchar(255) NOT NULL
4
+ )
5
+ go
@@ -0,0 +1,33 @@
1
+ DROP TABLE accounts;
2
+ DROP TABLE funny_jokes;
3
+ DROP TABLE companies;
4
+ DROP TABLE topics;
5
+ DROP TABLE developers;
6
+ DROP TABLE projects;
7
+ DROP TABLE developers_projects;
8
+ DROP TABLE customers;
9
+ DROP TABLE orders;
10
+ DROP TABLE movies;
11
+ DROP TABLE subscribers;
12
+ DROP TABLE booleantests;
13
+ DROP TABLE auto_id_tests;
14
+ DROP TABLE entrants;
15
+ DROP TABLE colnametests;
16
+ DROP TABLE mixins;
17
+ DROP TABLE people;
18
+ DROP TABLE readers;
19
+ DROP TABLE binaries;
20
+ DROP TABLE computers;
21
+ DROP TABLE posts;
22
+ DROP TABLE comments;
23
+ DROP TABLE authors;
24
+ DROP TABLE tasks;
25
+ DROP TABLE categories;
26
+ DROP TABLE categories_posts;
27
+ DROP TABLE fk_test_has_fk;
28
+ DROP TABLE fk_test_has_pk;
29
+ DROP TABLE keyboards;
30
+ DROP TABLE legacy_things;
31
+ DROP TABLE numeric_data;
32
+ DROP TABLE mixed_case_monkeys;
33
+ DROP TABLE minimalistics;
@@ -0,0 +1,218 @@
1
+ CREATE TABLE accounts (
2
+ id int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
3
+ firm_id int default NULL,
4
+ credit_limit int default NULL
5
+ );
6
+
7
+ CREATE TABLE funny_jokes (
8
+ id int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
9
+ name varchar(50) default NULL
10
+ );
11
+
12
+ CREATE TABLE companies (
13
+ id int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
14
+ type varchar(50) default NULL,
15
+ ruby_type varchar(50) default NULL,
16
+ firm_id int default NULL,
17
+ name varchar(50) default NULL,
18
+ client_of int default NULL,
19
+ rating int default 1
20
+ );
21
+
22
+ CREATE TABLE topics (
23
+ id int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
24
+ title varchar(255) default NULL,
25
+ author_name varchar(255) default NULL,
26
+ author_email_address varchar(255) default NULL,
27
+ written_on datetime default NULL,
28
+ bonus_time datetime default NULL,
29
+ last_read date default NULL,
30
+ content varchar(255) default NULL,
31
+ approved smallint default 1,
32
+ replies_count int default 0,
33
+ parent_id int default NULL,
34
+ type varchar(50) default NULL
35
+ );
36
+
37
+ CREATE TABLE developers (
38
+ id int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
39
+ name varchar(100) default NULL,
40
+ salary int default 70000,
41
+ created_at datetime default NULL,
42
+ updated_at datetime default NULL
43
+ );
44
+
45
+ CREATE TABLE projects (
46
+ id int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
47
+ name varchar(100) default NULL,
48
+ type varchar(255) default NULL
49
+ );
50
+
51
+ CREATE TABLE developers_projects (
52
+ developer_id int NOT NULL,
53
+ project_id int NOT NULL,
54
+ joined_on date default NULL,
55
+ access_level int default 1
56
+ );
57
+
58
+ CREATE TABLE orders (
59
+ id int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
60
+ name varchar(100) default NULL,
61
+ billing_customer_id int default NULL,
62
+ shipping_customer_id int default NULL
63
+ );
64
+
65
+
66
+ CREATE TABLE customers (
67
+ id int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
68
+ name varchar(100) default NULL,
69
+ balance int default 0,
70
+ address_street varchar(100) default NULL,
71
+ address_city varchar(100) default NULL,
72
+ address_country varchar(100) default NULL,
73
+ gps_location varchar(100) default NULL
74
+ );
75
+
76
+ CREATE TABLE movies (
77
+ movieid int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
78
+ name varchar(100) default NULL
79
+ );
80
+
81
+ CREATE TABLE subscribers (
82
+ nick varchar(100) NOT NULL PRIMARY KEY,
83
+ name varchar(100) default NULL
84
+ );
85
+
86
+ CREATE TABLE booleantests (
87
+ id int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
88
+ value smallint default NULL
89
+ );
90
+
91
+ CREATE TABLE auto_id_tests (
92
+ auto_id int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
93
+ value int default NULL
94
+ );
95
+
96
+ CREATE TABLE entrants (
97
+ id int NOT NULL PRIMARY KEY,
98
+ name varchar(255) NOT NULL,
99
+ course_id int NOT NULL
100
+ );
101
+
102
+ CREATE TABLE colnametests (
103
+ id int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
104
+ "references" int NOT NULL
105
+ );
106
+
107
+ CREATE TABLE mixins (
108
+ id int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
109
+ parent_id int default NULL,
110
+ pos int default NULL,
111
+ created_at datetime default NULL,
112
+ updated_at datetime default NULL,
113
+ lft int default NULL,
114
+ rgt int default NULL,
115
+ root_id int default NULL,
116
+ type varchar(40) default NULL
117
+ );
118
+
119
+ CREATE TABLE people (
120
+ id int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1),
121
+ first_name varchar(40) NULL,
122
+ lock_version int default 0,
123
+ PRIMARY KEY (id)
124
+ );
125
+
126
+ CREATE TABLE readers (
127
+ id int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
128
+ post_id int NOT NULL,
129
+ person_id int NOT NULL
130
+ );
131
+
132
+ CREATE TABLE binaries (
133
+ id int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
134
+ data long varbinary default NULL
135
+ );
136
+
137
+ CREATE TABLE computers (
138
+ id int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
139
+ developer int NOT NULL,
140
+ extendedWarranty int NOT NULL
141
+ );
142
+
143
+ CREATE TABLE posts (
144
+ id int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
145
+ author_id int default NULL,
146
+ title varchar(255) default NULL,
147
+ type varchar(255) default NULL,
148
+ body long varchar default NULL
149
+ );
150
+
151
+ CREATE TABLE comments (
152
+ id int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
153
+ post_id int default NULL,
154
+ type varchar(255) default NULL,
155
+ body long varchar default NULL
156
+ );
157
+
158
+ CREATE TABLE authors (
159
+ id int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
160
+ name varchar(255) default NULL
161
+ );
162
+
163
+ CREATE TABLE tasks (
164
+ id int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
165
+ starting datetime default NULL,
166
+ ending datetime default NULL
167
+ );
168
+
169
+ CREATE TABLE categories (
170
+ id int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
171
+ name varchar(255),
172
+ type varchar(255) default NULL
173
+ );
174
+
175
+ CREATE TABLE categories_posts (
176
+ category_id int NOT NULL,
177
+ post_id int NOT NULL
178
+ );
179
+
180
+ CREATE TABLE keyboards (
181
+ key_number int NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
182
+ name varchar(50) default NULL
183
+ );
184
+
185
+ CREATE TABLE fk_test_has_pk (
186
+ id INTEGER NOT NULL PRIMARY KEY
187
+ );
188
+
189
+ CREATE TABLE fk_test_has_fk (
190
+ id INTEGER NOT NULL PRIMARY KEY,
191
+ fk_id INTEGER NOT NULL,
192
+
193
+ FOREIGN KEY (fk_id) REFERENCES fk_test_has_pk(id)
194
+ );
195
+
196
+ CREATE TABLE legacy_things (
197
+ id INTEGER NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
198
+ tps_report_number int default NULL,
199
+ version int default 0
200
+ );
201
+
202
+ create table numeric_data (
203
+ id INTEGER NOT NULL IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY,
204
+ bank_balance decimal(10,2),
205
+ big_bank_balance decimal(15,2),
206
+ world_population decimal(10,0),
207
+ my_house_population decimal(2,0),
208
+ decimal_number_with_default decimal(3,2) DEFAULT 2.78
209
+ );
210
+
211
+ create table mixed_case_monkeys (
212
+ monkeyID INTEGER NOT NULL PRIMARY KEY,
213
+ fleaCount INTEGER
214
+ );
215
+
216
+ create table minimalistics (
217
+ id INT NOT NULL PRIMARY KEY
218
+ );
@@ -0,0 +1,2 @@
1
+ DROP TABLE courses;
2
+
@@ -0,0 +1,5 @@
1
+ CREATE TABLE courses (
2
+ id int NOT NULL PRIMARY KEY,
3
+ name varchar(255) NOT NULL
4
+ );
5
+
metadata ADDED
@@ -0,0 +1,166 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: activerecord-odbc-adapter
3
+ version: !ruby/object:Gem::Version
4
+ version: "2.0"
5
+ platform: ruby
6
+ authors:
7
+ - Carl Blakeley
8
+ autorequire: odbc_adapter
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-04-23 00:00:00 +02:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: activerecord
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 2.0.2
23
+ version:
24
+ description:
25
+ email: cblakeley@openlinksw.co.uk
26
+ executables: []
27
+
28
+ extensions: []
29
+
30
+ extra_rdoc_files:
31
+ - README
32
+ - COPYING
33
+ files:
34
+ - lib/connection_adapters
35
+ - lib/active_record
36
+ - lib/active_record/connection_adapters
37
+ - lib/active_record/connection_adapters/odbc_adapter.rb
38
+ - lib/active_record/vendor
39
+ - lib/active_record/vendor/odbcext_oracle.rb
40
+ - lib/active_record/vendor/odbcext_informix.rb
41
+ - lib/active_record/vendor/odbcext_progress89.rb
42
+ - lib/active_record/vendor/odbcext_microsoftsqlserver_col.rb
43
+ - lib/active_record/vendor/odbcext_informix_col.rb
44
+ - lib/active_record/vendor/odbcext_sqlanywhere.rb
45
+ - lib/active_record/vendor/odbcext_postgresql.rb
46
+ - lib/active_record/vendor/odbcext_sybase_col.rb
47
+ - lib/active_record/vendor/odbcext_mysql.rb
48
+ - lib/active_record/vendor/odbcext_db2.rb
49
+ - lib/active_record/vendor/odbcext_progress.rb
50
+ - lib/active_record/vendor/odbcext_microsoftsqlserver.rb
51
+ - lib/active_record/vendor/odbcext_ingres.rb
52
+ - lib/active_record/vendor/odbcext_sqlanywhere_col.rb
53
+ - lib/active_record/vendor/odbcext_virtuoso.rb
54
+ - lib/active_record/vendor/odbcext_sybase.rb
55
+ - lib/odbc_adapter.rb
56
+ - test/connections
57
+ - test/connections/native_odbc
58
+ - test/connections/native_odbc/connection.rb
59
+ - test/fixtures
60
+ - test/fixtures/db_definitions
61
+ - test/fixtures/db_definitions/db22.drop.sql
62
+ - test/fixtures/db_definitions/progress2.drop.sql
63
+ - test/fixtures/db_definitions/ingres2.sql
64
+ - test/fixtures/db_definitions/oracle_odbc.drop.sql
65
+ - test/fixtures/db_definitions/mysql2.sql
66
+ - test/fixtures/db_definitions/virtuoso.sql
67
+ - test/fixtures/db_definitions/virtuoso2.drop.sql
68
+ - test/fixtures/db_definitions/postgresql2.sql
69
+ - test/fixtures/db_definitions/db2.drop.sql
70
+ - test/fixtures/db_definitions/informix2.sql
71
+ - test/fixtures/db_definitions/postgresql2.drop.sql
72
+ - test/fixtures/db_definitions/progress2.sql
73
+ - test/fixtures/db_definitions/mysql.drop.sql
74
+ - test/fixtures/db_definitions/sybase2.sql
75
+ - test/fixtures/db_definitions/sybase.sql
76
+ - test/fixtures/db_definitions/mysql.sql
77
+ - test/fixtures/db_definitions/sqlserver2.sql
78
+ - test/fixtures/db_definitions/oracle_odbc2.drop.sql
79
+ - test/fixtures/db_definitions/sqlserver.drop.sql
80
+ - test/fixtures/db_definitions/virtuoso2.sql
81
+ - test/fixtures/db_definitions/db2.sql
82
+ - test/fixtures/db_definitions/ingres.sql
83
+ - test/fixtures/db_definitions/oracle_odbc.sql
84
+ - test/fixtures/db_definitions/progress.drop.sql
85
+ - test/fixtures/db_definitions/sqlserver.sql
86
+ - test/fixtures/db_definitions/sybase.drop.sql
87
+ - test/fixtures/db_definitions/postgresql.sql
88
+ - test/fixtures/db_definitions/informix2.drop.sql
89
+ - test/fixtures/db_definitions/mysql2.drop.sql
90
+ - test/fixtures/db_definitions/progress.sql
91
+ - test/fixtures/db_definitions/sqlserver2.drop.sql
92
+ - test/fixtures/db_definitions/virtuoso.drop.sql
93
+ - test/fixtures/db_definitions/informix.drop.sql
94
+ - test/fixtures/db_definitions/db22.sql
95
+ - test/fixtures/db_definitions/sybase2.drop.sql
96
+ - test/fixtures/db_definitions/informix.sql
97
+ - test/fixtures/db_definitions/postgresql.drop.sql
98
+ - test/fixtures/db_definitions/ingres2.drop.sql
99
+ - test/fixtures/db_definitions/oracle_odbc2.sql
100
+ - test/fixtures/db_definitions/ingres.drop.sql
101
+ - support/pack_odbc.rb
102
+ - support/odbc_rails.diff
103
+ - support/lib
104
+ - support/lib/active_record
105
+ - support/lib/active_record/connection_adapters
106
+ - support/lib/active_record/connection_adapters/abstract
107
+ - support/lib/active_record/connection_adapters/abstract/schema_definitions.rb
108
+ - support/rake_fixes
109
+ - support/rake_fixes/databases.dif
110
+ - support/rake_fixes/README
111
+ - support/rake
112
+ - support/rake/rails_plugin_package_task.rb
113
+ - support/test
114
+ - support/test/migration_test.rb
115
+ - support/test/base_test.rb
116
+ - AUTHORS
117
+ - ChangeLog
118
+ - COPYING
119
+ - LICENSE
120
+ - NEWS
121
+ - README
122
+ has_rdoc: true
123
+ homepage: http://odbc-rails.rubyforge.org
124
+ post_install_message:
125
+ rdoc_options:
126
+ - --title
127
+ - OpenLink ODBC Adapter for Ruby on Rails
128
+ - --line-numbers
129
+ - --inline-source
130
+ - --main
131
+ - README
132
+ - --exclude
133
+ - lib/odbc_adapter.rb
134
+ - --exclude
135
+ - pack_odbc.rb
136
+ - --exclude
137
+ - vendor
138
+ - --exclude
139
+ - support
140
+ - --exclude
141
+ - test
142
+ - --include
143
+ - active_record/connection_adapters/*.rb
144
+ require_paths:
145
+ - lib
146
+ required_ruby_version: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ version: "0"
151
+ version:
152
+ required_rubygems_version: !ruby/object:Gem::Requirement
153
+ requirements:
154
+ - - ">="
155
+ - !ruby/object:Gem::Version
156
+ version: "0"
157
+ version:
158
+ requirements: []
159
+
160
+ rubyforge_project:
161
+ rubygems_version: 1.1.1
162
+ signing_key:
163
+ specification_version: 2
164
+ summary: ODBC Data Adapter for ActiveRecord
165
+ test_files: []
166
+