ibm_db 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +23 -0
- data/LICENSE +18 -0
- data/MANIFEST +14 -0
- data/README +219 -0
- data/ext/extconf.rb +50 -0
- data/ext/ibm_db.c +6259 -0
- data/ext/ruby_ibm_db.h +164 -0
- data/init.rb +42 -0
- data/lib/IBM_DB.rb +2 -0
- data/lib/active_record/connection_adapters/ibm_db_adapter.rb +1053 -0
- data/lib/active_record/vendor/db2-i5-zOS.yaml +328 -0
- data/lib/linux32/ibm_db.so +0 -0
- data/test/activerecord/native_ibm_db/connection.rb +39 -0
- data/test/ibm_db_test.rb +25 -0
- metadata +78 -0
@@ -0,0 +1,328 @@
|
|
1
|
+
add : ADD
|
2
|
+
after : AFTER
|
3
|
+
alias : ALIAS # I-5 Reserved Word
|
4
|
+
all : ALL
|
5
|
+
allocate : ALLOCATE
|
6
|
+
allow : ALLOW
|
7
|
+
alter : ALTER
|
8
|
+
and : AND
|
9
|
+
any : ANY
|
10
|
+
as : AS
|
11
|
+
asensitive : ASENSITIVE
|
12
|
+
associate : ASSOCIATE
|
13
|
+
asutime : ASUTIME
|
14
|
+
audit : AUDIT
|
15
|
+
authorization : AUTHORIZATION # I-5 Reserved Word
|
16
|
+
aux : AUX
|
17
|
+
auxiliary : AUXILIARY
|
18
|
+
before : BEFORE
|
19
|
+
begin : BEGIN
|
20
|
+
between : BETWEEN
|
21
|
+
binary : BINARY # I-5 Reserved Word
|
22
|
+
bufferpool : BUFFERPOOL
|
23
|
+
by : BY
|
24
|
+
cache : CACHE # I-5 Reserved Word
|
25
|
+
call : CALL
|
26
|
+
called : CALLED # I-5 Reserved Word
|
27
|
+
cardinality : CARDINALITY # I-5 Reserved Word
|
28
|
+
capture : CAPTURE
|
29
|
+
cascaded : CASCADED
|
30
|
+
case : CASE
|
31
|
+
cast : CAST
|
32
|
+
ccsid : CCSID
|
33
|
+
char : CHAR
|
34
|
+
character : CHARACTER
|
35
|
+
check : CHECK
|
36
|
+
close : CLOSE
|
37
|
+
cluster : CLUSTER
|
38
|
+
collection : COLLECTION
|
39
|
+
collid : COLLID
|
40
|
+
column : COLUMN
|
41
|
+
comment : COMMENT
|
42
|
+
commit : COMMIT
|
43
|
+
concat : CONCAT
|
44
|
+
condition : CONDITION
|
45
|
+
connect : CONNECT
|
46
|
+
connection : CONNECTION
|
47
|
+
constraint : CONSTRAINT
|
48
|
+
contains : CONTAINS
|
49
|
+
continue : CONTINUE
|
50
|
+
count : COUNT # I-5 Reserved Word
|
51
|
+
count_big : COUNT_BIG # I-5 Reserved Word
|
52
|
+
create : CREATE
|
53
|
+
cross : CROSS # I-5 Reserved Word
|
54
|
+
current : CURRENT
|
55
|
+
current_date : CURRENT_DATE
|
56
|
+
current_lc_ctype : CURRENT_LC_CTYPE
|
57
|
+
current_path : CURRENT_PATH
|
58
|
+
current_time : CURRENT_TIME
|
59
|
+
current_timestamp : CURRENT_TIMESTAMP
|
60
|
+
current_timezone : CURRENT_TIMEZONE # I-5 Reserved Word
|
61
|
+
current_user : CURRENT_USER # I-5 Reserved Word
|
62
|
+
cursor : CURSOR
|
63
|
+
cycle : CYCLE # I-5 Reserved Word
|
64
|
+
data : DATA
|
65
|
+
database : DATABASE
|
66
|
+
day : DAY
|
67
|
+
days : DAYS
|
68
|
+
dbinfo : DBINFO
|
69
|
+
db2genrl : DB2GENRL # I-5 Reserved Word
|
70
|
+
db2sql : DB2SQL # I-5 Reserved Word
|
71
|
+
declare : DECLARE
|
72
|
+
default : DEFAULT
|
73
|
+
defaults : DEFAULTS # I-5 Reserved Word
|
74
|
+
definition : DEFINITION # I-5 Reserved Word
|
75
|
+
delete : DELETE
|
76
|
+
descriptor : DESCRIPTOR
|
77
|
+
deterministic : DETERMINISTIC
|
78
|
+
disallow : DISALLOW
|
79
|
+
disconnect : DISCONNECT
|
80
|
+
distinct : DISTINCT
|
81
|
+
do : DO
|
82
|
+
double : DOUBLE
|
83
|
+
drop : DROP
|
84
|
+
dssize : DSSIZE
|
85
|
+
dynamic : DYNAMIC
|
86
|
+
each : EACH # I-5 Reserved Word
|
87
|
+
editproc : EDITPROC
|
88
|
+
else : ELSE
|
89
|
+
elseif : ELSEIF
|
90
|
+
encoding : ENCODING
|
91
|
+
encryption : ENCRYPTION
|
92
|
+
end : END
|
93
|
+
ending : ENDING
|
94
|
+
end-exec : END-EXEC
|
95
|
+
erase : ERASE
|
96
|
+
escape : ESCAPE
|
97
|
+
except : EXCEPT
|
98
|
+
excluding : EXCLUDING # I-5 Reserved Word
|
99
|
+
exception : EXCEPTION
|
100
|
+
execute : EXECUTE
|
101
|
+
exists : EXISTS
|
102
|
+
exit : EXIT
|
103
|
+
explain : EXPLAIN
|
104
|
+
external : EXTERNAL
|
105
|
+
fenced : FENCED
|
106
|
+
fetch : FETCH
|
107
|
+
fieldproc : FIELDPROC
|
108
|
+
file : FILE # I-5 Reserved Word
|
109
|
+
final : FINAL
|
110
|
+
for : FOR
|
111
|
+
foreign : FOREIGN # I-5 Reserved Word
|
112
|
+
free : FREE
|
113
|
+
from : FROM
|
114
|
+
full : FULL
|
115
|
+
function : FUNCTION
|
116
|
+
general : GENERAL # I-5 Reserved Word
|
117
|
+
generated : GENERATED
|
118
|
+
get : GET
|
119
|
+
global : GLOBAL
|
120
|
+
go : GO
|
121
|
+
goto : GOTO
|
122
|
+
grant : GRANT
|
123
|
+
graphic : GRAPHIC # I-5 Reserved Word
|
124
|
+
group : GROUP
|
125
|
+
handler : HANDLER
|
126
|
+
having : HAVING
|
127
|
+
hold : HOLD
|
128
|
+
hour : HOUR
|
129
|
+
hours : HOURS
|
130
|
+
identity : IDENTITY # I-5 Reserved Word
|
131
|
+
if : IF
|
132
|
+
immediate : IMMEDIATE
|
133
|
+
in : IN
|
134
|
+
including : INCLUDING # I-5 Reserved Word
|
135
|
+
inclusive : INCLUSIVE
|
136
|
+
increment : INCREMENT # I-5 Reserved Word
|
137
|
+
index : INDEX
|
138
|
+
indicator : INDICATOR # I-5 Reserved Word
|
139
|
+
inherit : INHERIT
|
140
|
+
inner : INNER
|
141
|
+
inout : INOUT
|
142
|
+
insensitive : INSENSITIVE
|
143
|
+
insert : INSERT
|
144
|
+
integrity : INTEGRITY # I-5 Reserved Word
|
145
|
+
into : INTO
|
146
|
+
is : IS
|
147
|
+
isobid : ISOBID
|
148
|
+
isolation : ISOLATION # I-5 Reserved Word
|
149
|
+
iterate : ITERATE
|
150
|
+
jar : JAR
|
151
|
+
java : JAVA # I-5 Reserved Word
|
152
|
+
join : JOIN
|
153
|
+
key : KEY
|
154
|
+
label : LABEL
|
155
|
+
language : LANGUAGE
|
156
|
+
lc_ctype : LC_CTYPE
|
157
|
+
leave : LEAVE
|
158
|
+
left : LEFT
|
159
|
+
like : LIKE
|
160
|
+
linktype : LINKTYPE # I-5 Reserved Word
|
161
|
+
local : LOCAL
|
162
|
+
locale : LOCALE
|
163
|
+
locator : LOCATOR
|
164
|
+
locators : LOCATORS
|
165
|
+
lock : LOCK
|
166
|
+
lockmax : LOCKMAX
|
167
|
+
locksize : LOCKSIZE
|
168
|
+
long : LONG
|
169
|
+
loop : LOOP
|
170
|
+
maintained : MAINTAINED
|
171
|
+
materialized : MATERIALIZED
|
172
|
+
maxvalue : MAXVALUE # I-5 Reserved Word
|
173
|
+
microsecond : MICROSECOND
|
174
|
+
microseconds : MICROSECONDS
|
175
|
+
minute : MINUTE
|
176
|
+
minutes : MINUTES
|
177
|
+
minvalue : MINVALUE # I-5 Reserved Word
|
178
|
+
mode : MODE # I-5 Reserved Word
|
179
|
+
modifies : MODIFIES
|
180
|
+
month : MONTH
|
181
|
+
months : MONTHS
|
182
|
+
new : NEW # I-5 Reserved Word
|
183
|
+
new_table : NEW_TABLE # I-5 Reserved Word
|
184
|
+
nextval : NEXTVAL
|
185
|
+
no : NO
|
186
|
+
nocache : NOCACHE # I-5 Reserved Word
|
187
|
+
nocycle : NOCYCLE # I-5 Reserved Word
|
188
|
+
nodename : NODENAME # I-5 Reserved Word
|
189
|
+
nodenumber : NODENUMBER # I-5 Reserved Word
|
190
|
+
nomaxvalue : NOMAXVALUE # I-5 Reserved Word
|
191
|
+
nominvalue : NOMINVALUE # I-5 Reserved Word
|
192
|
+
none : NONE
|
193
|
+
noorder : NOORDER # I-5 Reserved Word
|
194
|
+
not : NOT
|
195
|
+
null : NULL
|
196
|
+
nulls : NULLS
|
197
|
+
numparts : NUMPARTS
|
198
|
+
obid : OBID
|
199
|
+
of : OF
|
200
|
+
old : OLD # I-5 Reserved Word
|
201
|
+
old_table : OLD_TABLE # I-5 Reserved Word
|
202
|
+
on : ON
|
203
|
+
open : OPEN
|
204
|
+
optimization : OPTIMIZATION
|
205
|
+
optimize : OPTIMIZE
|
206
|
+
option : OPTION # I-5 Reserved Word
|
207
|
+
or : OR
|
208
|
+
order : ORDER
|
209
|
+
out : OUT
|
210
|
+
outer : OUTER
|
211
|
+
overriding : OVERRIDING # I-5 Reserved Word
|
212
|
+
package : PACKAGE
|
213
|
+
parameter : PARAMETER
|
214
|
+
part : PART
|
215
|
+
padded : PADDED
|
216
|
+
partition : PARTITION
|
217
|
+
partitioned : PARTITIONED
|
218
|
+
partitioning : PARTITIONING
|
219
|
+
path : PATH
|
220
|
+
piecesize : PIECESIZE
|
221
|
+
plan : PLAN
|
222
|
+
position : POSITION # I-5 Reserved Word
|
223
|
+
precision : PRECISION
|
224
|
+
prepare : PREPARE
|
225
|
+
prevval : PREVVAL
|
226
|
+
primary : PRIMARY # I-5 Reserved Word
|
227
|
+
priqty : PRIQTY
|
228
|
+
privileges : PRIVILEGES
|
229
|
+
procedure : PROCEDURE
|
230
|
+
program : PROGRAM
|
231
|
+
psid : PSID
|
232
|
+
query : QUERY
|
233
|
+
queryno : QUERYNO
|
234
|
+
read : READ # I-5 Reserved Word
|
235
|
+
reads : READS
|
236
|
+
recovery : RECOVERY # I-5 Reserved Word
|
237
|
+
references : REFERENCES
|
238
|
+
referencing : REFERENCING # I-5 Reserved Word
|
239
|
+
refresh : REFRESH
|
240
|
+
resignal : RESIGNAL
|
241
|
+
release : RELEASE
|
242
|
+
rename : RENAME
|
243
|
+
repeat : REPEAT
|
244
|
+
reset : RESET # I-5 Reserved Word
|
245
|
+
resignal : RESIGNAL # I-5 Reserved Word
|
246
|
+
restart : RESTART # I-5 Reserved Word
|
247
|
+
restrict : RESTRICT
|
248
|
+
result : RESULT
|
249
|
+
result_set_locator : RESULT_SET_LOCATOR
|
250
|
+
return : RETURN
|
251
|
+
returns : RETURNS
|
252
|
+
revoke : REVOKE
|
253
|
+
right : RIGHT
|
254
|
+
rollback : ROLLBACK
|
255
|
+
routine : ROUTINE # I-5 Reserved Word
|
256
|
+
row : ROW # I-5 Reserved Word
|
257
|
+
rows : ROWS # I-5 Reserved Word
|
258
|
+
rowset : ROWSET
|
259
|
+
rrn : RRN # I-5 Reserved Word
|
260
|
+
run : RUN
|
261
|
+
savepoint : SAVEPOINT
|
262
|
+
schema : SCHEMA
|
263
|
+
scratchpad : SCRATCHPAD
|
264
|
+
second : SECOND
|
265
|
+
seconds : SECONDS
|
266
|
+
secqty : SECQTY
|
267
|
+
security : SECURITY
|
268
|
+
sequence : SEQUENCE
|
269
|
+
select : SELECT
|
270
|
+
sensitive : SENSITIVE
|
271
|
+
set : SET
|
272
|
+
signal : SIGNAL
|
273
|
+
simple : SIMPLE
|
274
|
+
some : SOME
|
275
|
+
source : SOURCE
|
276
|
+
specific : SPECIFIC
|
277
|
+
sql : SQL # I-5 Reserved Word
|
278
|
+
sqlid : SQLID # I-5 Reserved Word
|
279
|
+
standard : STANDARD
|
280
|
+
start : START # I-5 Reserved Word
|
281
|
+
static : STATIC
|
282
|
+
stay : STAY
|
283
|
+
stogroup : STOGROUP
|
284
|
+
stores : STORES
|
285
|
+
style : STYLE
|
286
|
+
substring : SUBSTRING # I-5 Reserved Word
|
287
|
+
summary : SUMMARY
|
288
|
+
synonym : SYNONYM
|
289
|
+
sysfun : SYSFUN
|
290
|
+
sysibm : SYSIBM
|
291
|
+
sysproc : SYSPROC
|
292
|
+
system : SYSTEM
|
293
|
+
table : TABLE
|
294
|
+
tablespace : TABLESPACE
|
295
|
+
then : THEN
|
296
|
+
to : TO
|
297
|
+
transaction : TRANSACTION # I-5 Reserved Word
|
298
|
+
trigger : TRIGGER
|
299
|
+
trim : TRIM # I-5 Reserved Word
|
300
|
+
type : TYPE # I-5 Reserved Word
|
301
|
+
undo : UNDO
|
302
|
+
union : UNION
|
303
|
+
unique : UNIQUE
|
304
|
+
until : UNTIL
|
305
|
+
update : UPDATE
|
306
|
+
user : USER
|
307
|
+
usage : USAGE # I-5 Reserved Word
|
308
|
+
user : USER # I-5 Reserved Word
|
309
|
+
using : USING
|
310
|
+
validproc : VALIDPROC
|
311
|
+
value : VALUE
|
312
|
+
values : VALUES
|
313
|
+
variable : VARIABLE
|
314
|
+
variant : VARIANT
|
315
|
+
vcat : VCAT
|
316
|
+
view : VIEW
|
317
|
+
volatile : VOLATILE
|
318
|
+
volumes : VOLUMES
|
319
|
+
when : WHEN
|
320
|
+
whenever : WHENEVER
|
321
|
+
where : WHERE
|
322
|
+
while : WHILE
|
323
|
+
with : WITH
|
324
|
+
wlm : WLM
|
325
|
+
write : WRITE # I-5 Reserved Word
|
326
|
+
xmlelement : XMLELEMENT
|
327
|
+
year : YEAR
|
328
|
+
years : YEARS
|
Binary file
|
@@ -0,0 +1,39 @@
|
|
1
|
+
#
|
2
|
+
# Licensed Materials - Property of IBM
|
3
|
+
#
|
4
|
+
# (c) Copyright IBM Corp. 2006
|
5
|
+
#
|
6
|
+
|
7
|
+
print "Using native IBM_DB\n"
|
8
|
+
require_dependency 'fixtures/course'
|
9
|
+
require 'logger'
|
10
|
+
|
11
|
+
#ActiveRecord::Base.logger = Logger.new("ibm_db.log")
|
12
|
+
ActiveRecord::Base.logger = Logger.new STDOUT
|
13
|
+
ActiveRecord::Base.logger.level = Logger::FATAL
|
14
|
+
|
15
|
+
ActiveRecord::Base.configurations = {
|
16
|
+
'arunit' => {
|
17
|
+
:adapter => 'ibm_db',
|
18
|
+
:username => 'db2user',
|
19
|
+
:password => 'secret',
|
20
|
+
:schema => 'rails123',
|
21
|
+
:account => 'tester',
|
22
|
+
:application => 'rails_tests',
|
23
|
+
:workstation => 'auckland',
|
24
|
+
:database => 'ARUNIT'
|
25
|
+
},
|
26
|
+
'arunit2' => {
|
27
|
+
:adapter => 'ibm_db',
|
28
|
+
:username => 'db2user',
|
29
|
+
:password => 'secret',
|
30
|
+
:schema => 'rails123',
|
31
|
+
:account => 'tester',
|
32
|
+
:application => 'rails_tests',
|
33
|
+
:workstation => 'auckland',
|
34
|
+
:database => 'ARUNIT2'
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
ActiveRecord::Base.establish_connection 'arunit'
|
39
|
+
Course.establish_connection 'arunit2'
|
data/test/ibm_db_test.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
|
3
|
+
class IBM_DBAdapterTest < Test::Unit::TestCase
|
4
|
+
require 'pathname'
|
5
|
+
|
6
|
+
# Fixture
|
7
|
+
def driver_lib_path
|
8
|
+
drv_path = Pathname.new(File.dirname(__FILE__)).parent + 'lib'
|
9
|
+
drv_path += (RUBY_PLATFORM =~ /mswin32/) ? 'mswin32' : 'linux32'
|
10
|
+
drv_path += 'ibm_db.so'
|
11
|
+
end
|
12
|
+
|
13
|
+
# Check IBM_DB Ruby driver for this platform: #{RUBY_PLATFORM}
|
14
|
+
def test_driver_existence
|
15
|
+
driver = driver_lib_path
|
16
|
+
assert driver.file?
|
17
|
+
end
|
18
|
+
|
19
|
+
# Attempt loading IBM_DB Ruby driver for this platform: #{RUBY_PLATFORM}
|
20
|
+
def test_driver_loading
|
21
|
+
driver = driver_lib_path
|
22
|
+
require "#{driver.to_s}"
|
23
|
+
assert true
|
24
|
+
end
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.9.2
|
3
|
+
specification_version: 1
|
4
|
+
name: ibm_db
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 0.4.0
|
7
|
+
date: 2007-03-22 00:00:00 -04:00
|
8
|
+
summary: "Rails Driver and Adapter for IBM Data Servers: {LUW, zOS, i5, IDS}"
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
email: rubyibm-developers@rubyforge.org
|
12
|
+
homepage: http://rubyforge.org/projects/rubyibm/
|
13
|
+
rubyforge_project: rubyibm
|
14
|
+
description:
|
15
|
+
autorequire:
|
16
|
+
default_executable:
|
17
|
+
bindir: bin
|
18
|
+
has_rdoc: true
|
19
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.8.5
|
24
|
+
version:
|
25
|
+
platform: ruby
|
26
|
+
signing_key:
|
27
|
+
cert_chain:
|
28
|
+
post_install_message:
|
29
|
+
authors:
|
30
|
+
- IBM
|
31
|
+
files:
|
32
|
+
- test
|
33
|
+
- ext
|
34
|
+
- lib
|
35
|
+
- init.rb
|
36
|
+
- MANIFEST
|
37
|
+
- CHANGES
|
38
|
+
- README
|
39
|
+
- LICENSE
|
40
|
+
- test/activerecord
|
41
|
+
- test/ibm_db_test.rb
|
42
|
+
- test/activerecord/native_ibm_db
|
43
|
+
- test/activerecord/native_ibm_db/connection.rb
|
44
|
+
- ext/ruby_ibm_db.h
|
45
|
+
- ext/extconf.rb
|
46
|
+
- ext/ibm_db.c
|
47
|
+
- lib/linux32
|
48
|
+
- lib/active_record
|
49
|
+
- lib/IBM_DB.rb
|
50
|
+
- lib/linux32/ibm_db.so
|
51
|
+
- lib/active_record/connection_adapters
|
52
|
+
- lib/active_record/vendor
|
53
|
+
- lib/active_record/connection_adapters/ibm_db_adapter.rb
|
54
|
+
- lib/active_record/vendor/db2-i5-zOS.yaml
|
55
|
+
test_files:
|
56
|
+
- test/ibm_db_test.rb
|
57
|
+
rdoc_options: []
|
58
|
+
|
59
|
+
extra_rdoc_files:
|
60
|
+
- CHANGES
|
61
|
+
- README
|
62
|
+
- MANIFEST
|
63
|
+
executables: []
|
64
|
+
|
65
|
+
extensions:
|
66
|
+
- ext/extconf.rb
|
67
|
+
requirements:
|
68
|
+
- ActiveRecord, at least 1.15.1
|
69
|
+
dependencies:
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: activerecord
|
72
|
+
version_requirement:
|
73
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 1.15.1
|
78
|
+
version:
|