ibm_db 2.5.26-universal-darwin-14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGES +233 -0
- data/LICENSE +18 -0
- data/MANIFEST +14 -0
- data/ParameterizedQueries README +39 -0
- data/README +225 -0
- data/ext/Makefile.nt32 +181 -0
- data/ext/Makefile.nt32.191 +212 -0
- data/ext/extconf.rb +261 -0
- data/ext/ibm_db.c +11793 -0
- data/ext/ruby_ibm_db.h +240 -0
- data/ext/ruby_ibm_db_cli.c +845 -0
- data/ext/ruby_ibm_db_cli.h +489 -0
- data/init.rb +42 -0
- data/lib/IBM_DB.rb +19 -0
- data/lib/active_record/connection_adapters/ibm_db_adapter.rb +3289 -0
- data/lib/active_record/connection_adapters/ibm_db_pstmt.rb +1965 -0
- data/lib/active_record/connection_adapters/ibmdb_adapter.rb +2 -0
- data/lib/active_record/vendor/db2-i5-zOS.yaml +328 -0
- data/lib/linux/rb18x/ibm_db.bundle +0 -0
- data/lib/linux/rb19x/ibm_db.bundle +0 -0
- data/lib/linux/rb20x/ibm_db.bundle +0 -0
- data/lib/linux/rb21x/ibm_db.bundle +0 -0
- data/test/cases/adapter_test.rb +207 -0
- data/test/cases/associations/belongs_to_associations_test.rb +711 -0
- data/test/cases/associations/cascaded_eager_loading_test.rb +181 -0
- data/test/cases/associations/has_and_belongs_to_many_associations_test.rb +851 -0
- data/test/cases/associations/join_model_test.rb +743 -0
- data/test/cases/attribute_methods_test.rb +822 -0
- data/test/cases/base_test.rb +2133 -0
- data/test/cases/calculations_test.rb +482 -0
- data/test/cases/migration_test.rb +2408 -0
- data/test/cases/persistence_test.rb +642 -0
- data/test/cases/query_cache_test.rb +257 -0
- data/test/cases/relations_test.rb +1182 -0
- data/test/cases/schema_dumper_test.rb +256 -0
- data/test/cases/transaction_callbacks_test.rb +300 -0
- data/test/cases/validations/uniqueness_validation_test.rb +299 -0
- data/test/cases/xml_serialization_test.rb +408 -0
- data/test/config.yml +154 -0
- data/test/connections/native_ibm_db/connection.rb +44 -0
- data/test/ibm_db_test.rb +25 -0
- data/test/models/warehouse_thing.rb +5 -0
- data/test/schema/i5/ibm_db_specific_schema.rb +137 -0
- data/test/schema/ids/ibm_db_specific_schema.rb +140 -0
- data/test/schema/luw/ibm_db_specific_schema.rb +137 -0
- data/test/schema/schema.rb +751 -0
- data/test/schema/zOS/ibm_db_specific_schema.rb +208 -0
- metadata +114 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a89f1df0cada9ef8370f10f1d7ecf6c46ad3bf6d
|
4
|
+
data.tar.gz: d1b0b8b53098c0df958acf9f92ed04d46deb071a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: beac5f73962c134c4c67f89b56b7a51510a75712370f422f614e94ff8861406e1fa7a9f9198dd5f623c4b550b3fa1d64ec8b026d41408ed71a88cd059516f701
|
7
|
+
data.tar.gz: 2c5889a07c785a3e824f7c423e1686c5984d6493b8391cf26150098cd63c9dff7f2a492050b78c8acc37cfd9709d415ab87a5b35e285a4cf00a6a9089f16a4ce
|
data/CHANGES
ADDED
@@ -0,0 +1,233 @@
|
|
1
|
+
Change Log
|
2
|
+
==============
|
3
|
+
|
4
|
+
2015/04/08 (IBM_DB adapter 2.5.26, driver 2.5.26)
|
5
|
+
- Fixed bug#22 - Error 'undefined method lookup_cast_type encountered' with rails version lesser than 4.2
|
6
|
+
|
7
|
+
2015/03/24 (IBM_DB adapter 2.5.25, driver 2.5.25)
|
8
|
+
- Support for Rails 4.2.x
|
9
|
+
- Support for Ruby 2.2.x on Windows and Linux platform
|
10
|
+
|
11
|
+
2014/08/03 (IBM_DB adapter 2.5.18, driver 2.5.14) :
|
12
|
+
- Support for Rails 4.1.x
|
13
|
+
- Enhanced installation to pull IBM Data Server Driver automatically if not present
|
14
|
+
|
15
|
+
2014/03/03 (IBM_DB adapter 2.5.17, driver 2.5.14) :
|
16
|
+
- Shipping binaries compatible with Ruby 2.0 for linux x86_64 systems (#29871)
|
17
|
+
- Fixed #29869
|
18
|
+
- Support microsecond timestamp.
|
19
|
+
|
20
|
+
2014/02/26 (IBM_DB adapter 2.5.16, driver 2.5.14) :
|
21
|
+
- Yanked version 2.5.15. Hence using new version number
|
22
|
+
|
23
|
+
2014/02/17 (IBM_DB adapter 2.5.15, driver 2.5.14) :
|
24
|
+
- Yanked version 2.5.14. Hence using new version number
|
25
|
+
|
26
|
+
2014/02/11 (IBM_DB adapter 2.5.14, driver 2.5.14) :
|
27
|
+
- Support for Rails 4
|
28
|
+
- Support for ruby-2.0
|
29
|
+
|
30
|
+
2014/01/28 (IBM_DB adapter 2.5.12, driver 2.5.11) :
|
31
|
+
- Supporting usage of name ibmdb as adapter along with current name ibm_db to support requirements of cloud environments
|
32
|
+
|
33
|
+
2012/12/07 (IBM_DB adapter 2.5.11, driver 2.5.11) :
|
34
|
+
- Fixed bug #29633 - Deletes cause too many handles to be consumed and not freed
|
35
|
+
- Support for Mac OS CLI library loading to check create and drop db functionality - #29625
|
36
|
+
- Fixed #29657 - @servertype of IBM_DBAdapter could end up being nil on DB2 for Z/OS version 9
|
37
|
+
|
38
|
+
2012/05/01 (IBM_DB adapter 2.5.10, driver 2.5.10) :
|
39
|
+
- Support for Rails-3.2
|
40
|
+
- Changes in installation process. Now user should set only one environment variable IBM_DB_HOME to DB2/IBM_Data_Server_Driver installation directory
|
41
|
+
- Fixed bug #29541 - Serialize data when corresponding field maps to CLOB type on Database
|
42
|
+
- Fixed bug #29561 - Fixed data truncation error when client and server codepages are different
|
43
|
+
- Updated IBM_DB specifics of AR test suite as per Rails-3.2.3
|
44
|
+
|
45
|
+
2012/01/03 (IBM_DB adapter 2.5.9, driver 2.5.9) :
|
46
|
+
- Support for Create and Drop database on DB2 LUW with DB2 client version V97fp4 and above
|
47
|
+
- Fixed bug #29482 - Fixed bigint being returned as string in the adapter
|
48
|
+
|
49
|
+
2011/09/18 (IBM_DB adapter 2.5.7, driver 2.5.7) :
|
50
|
+
- Support for Rails-3.1.0
|
51
|
+
- Fixed bug #29052 -> prepare results in empty error message
|
52
|
+
- Support for continuation of method IBM_DB.conn_error and IBM_DB.conn_errormsg - #29324
|
53
|
+
- Test suite update as for Rails-3.1.0
|
54
|
+
|
55
|
+
2011/02/07 (IBM_DB adapter 2.5.6, driver 2.5.6) :
|
56
|
+
- Fixed Bug #28622, #28881
|
57
|
+
- Decimal datatypes will now be returned as BigDecimal type from the driver
|
58
|
+
- Changes to rollback any active transaction in the connection destructor method if connection is not explicitly closed
|
59
|
+
- Changes to have a single gem file for ruby 1.8 and ruby 1.9
|
60
|
+
2010/07/15 (IBM_DB adapter 2.5.5, driver 2.5.5) :
|
61
|
+
- Support for datatype Graphic and Vargraphic in driver and adapter [27965]
|
62
|
+
- Support for Bigint datatype in adapter.
|
63
|
+
- Fixed bug [28295] --> IBM_DB, Unicode Version, fails with encoding error against Informix Server
|
64
|
+
|
65
|
+
2010/05/12 (IBM_DB adapter 2.5.0, driver 2.5.0) :
|
66
|
+
- Support for Unicode with Ruby 1.9 [Data from the IBM_DB driver is returned in UTF8 format]
|
67
|
+
- Fixed bug [27954] --> Fixed Truncation of char for bit data containing a Null Terminator
|
68
|
+
- Removed handling of NilClass type data in quote method. Super class will handle appropriately.
|
69
|
+
|
70
|
+
2010/01/21 (IBM_DB adapter 2.0.0, driver 2.0.0) :
|
71
|
+
- Support for usage of parameterized SQL queries
|
72
|
+
- Exposed constant VERSION in the driver [Feature Request: #27231]
|
73
|
+
|
74
|
+
2009/08/21 (IBM_DB adapter 1.5.0, driver 1.5.0) :
|
75
|
+
- non-block enhancement in the ruby driver made for Ruby version 1.9. [support request #25023]
|
76
|
+
- New API's getErrormsg and getErrorstate for retrieving error messages/state added
|
77
|
+
- Re-defined raising of exception from driver. [Bug #26544]
|
78
|
+
- Made adapter changes as per the new API's exposed in the driver for retrieving error messages
|
79
|
+
- API's conn_errormsg and stmt_errormsg is been deprecated.
|
80
|
+
|
81
|
+
2009/07/28 (IBM_DB adapter 1.1.1, driver 1.1.0) :
|
82
|
+
- Fixed bug [26705] --> Fixed the problem of primary key value starting with 100
|
83
|
+
- Support for Activerecord-2.3.3
|
84
|
+
- Added method primary_key, which returns the primary key column name of the specified table
|
85
|
+
- Test suite updated
|
86
|
+
|
87
|
+
2009/06/17 (IBM_DB adapter 1.1.0, driver 1.1.0) :
|
88
|
+
- Support for Activerecord's Query Cache Mechanism
|
89
|
+
- rename_column support for DB2 on LUW version 9.7, DB2 on zOS 9 and enhanced rename_column support for Informix Dynamic Server
|
90
|
+
- Support for parameterized timestamp datatype feature of DB2 on LUW Version 9.7
|
91
|
+
- Enhanced support for Bigint datatype along with support for Bigserial datatype (with client version 9.7 and above) of IDS
|
92
|
+
- Callback method handle_lobs enhanced by making it to use prepared statements completely
|
93
|
+
- Handling of exceptions during fetch operations enabled
|
94
|
+
|
95
|
+
2009/03/24 (IBM_DB adapter 1.0.5, driver 1.0.5) :
|
96
|
+
- Support for Ruby-1.9.1
|
97
|
+
- Support for SQLRowcount in driver
|
98
|
+
- Support for Activerecord-2.3.2 [test suite updated]
|
99
|
+
- Fixed bug [24663] --> Fixed pre-mature clearing of the sql array in handle_lobs
|
100
|
+
- Fixed bug [23115] --> Fixed truncation of a nested query during update
|
101
|
+
- Fixed wrong setting of SQLID for schema on zOS 8 dataserver when schema is explicitly specified.
|
102
|
+
|
103
|
+
2009/03/06 (IBM_DB adapter 1.0.2, driver 1.0.1) :
|
104
|
+
- Support for specifying connection timeout in adapter
|
105
|
+
- Fixed Bug [23317] --> Fixed assumption of id as the primary key while updation/insertion of lob fields
|
106
|
+
- Fixed Bug [23389] --> Provided proper exception handling.
|
107
|
+
- Fixed the insertion of incorrect value for lob objects in case of has_and_belongs_to_many associations.
|
108
|
+
|
109
|
+
2008/12/18 (IBM_DB adapter 1.0.1, driver 1.0.1) :
|
110
|
+
- Support for datatype decfloat
|
111
|
+
- Changes in installation process. Now user should set IBM_DB_INCLUDE env variable instead of IBM_DB_DIR
|
112
|
+
- Support for specifying the Authentication type to be used during connection in adapter
|
113
|
+
- Corrected the ignorance of a connection, when the connection is successful with a warning
|
114
|
+
- ActiveRecord-2.2.2 test suite changes for IBM_DB
|
115
|
+
2008/11/06 (IBM_DB adapter 1.0.0, driver 0.10.0):
|
116
|
+
- Support for short-hand migration syntax for datatype char and double in create_table
|
117
|
+
- Support for short-hand migration syntax for datatypes xml, char and double in change_table
|
118
|
+
- Support for secure connections using SSL (SECURITY=SSL) feature of DB2 in Adapter
|
119
|
+
Note: - This is supported from client version V9.5fp2 and onwards
|
120
|
+
- Support for altering the nullability constraint of a column.
|
121
|
+
- Added correct mapping for datatype :double for DB2 and Informix (double precision)
|
122
|
+
- Method support_ddl_transactions? overridden to return true. Feature of Rails2.2
|
123
|
+
IBM Dataservers support transactional migrations.
|
124
|
+
- Change in the style of accessing driver methods
|
125
|
+
Changed from scope resolution operator to dot operator
|
126
|
+
IBM_DB::connect '<db_name>','<username>','<pwd>' to IBM_DB.connect '<db_name>','<username>','<pwd>'
|
127
|
+
- Fixed Bug [#22430] --> Fixed limit ignorance for type character [char]
|
128
|
+
- ActiveRecord-2.1.2 test suite changes for IBM_DB
|
129
|
+
|
130
|
+
2008/09/01 (IBM_DB adapter 0.10.0, driver 0.10.0):
|
131
|
+
- Added Trusted Context support in Driver
|
132
|
+
- Made changes for the correct Mapping of Informix DataTypes to Ruby DataTypes
|
133
|
+
- ActiveRecord-2.1.0 test suite changes appropriate for DB2/IDS is been updated
|
134
|
+
|
135
|
+
2008/06/24 (IBM_DB adapter 0.9.5, driver 0.9.5):
|
136
|
+
- Fixed Bug [#19222] --> Fixed fixture insertion of LOB columns for DB2
|
137
|
+
- Fixed Bug [#19970] --> Fixed Table schema dumper also dump views
|
138
|
+
- Fixed Bug [#20053] --> Fixed CLOB data with special chars contains null characters upon retrieval
|
139
|
+
- Fixed Bug [#20762] --> IBM_DB adapter with Rails 2.1 fails on rake db:migrate
|
140
|
+
- Cleaned up fix for Bug [#19223] and [#19224], indexes are now dumped as array without schema qualified name.
|
141
|
+
- Support for Rails-2.0.2
|
142
|
+
- Support for Rails-2.1.0
|
143
|
+
Rails-2.1.0 contains changes that generates Non-standard SQL in 2 noticed cases which won't work with SQL compliant databases like DB2
|
144
|
+
a. Handling Nullable columns in Table creation. [http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/398-non-standard-sql-generated-in-column-definition-for-nullable-columns-in-create-table-ddl-rails-2-1#ticket-398-2]
|
145
|
+
A workaround for this problem is provided from within ibm_db adapter.
|
146
|
+
b. Handling has_and_belongs_to_many association. [http://rails.lighthouseapp.com/projects/8994/tickets/394-patch-fixed-non-standard-sql-generated-by-preloading-has_and_belongs_to_many-associations].
|
147
|
+
It is not possible to provide a workaround for this from within the ibm_db adapter.
|
148
|
+
To workaround this problem please patch ActiveRecord-2.1.0 with the patch available at [http://rails.lighthouseapp.com/attachments/26975/association_preloading.diff]
|
149
|
+
|
150
|
+
2008/04/28 (IBM_DB adapter 0.9.4, driver 0.9.4):
|
151
|
+
- Fixed bug [#19679]--> invalid values being returned for blank or null in fetch_assoc
|
152
|
+
- Fixed bug [#19223] and [#19224]--> handling of composite and unique indexes incorrect
|
153
|
+
- Support for the Rails2.0 type of migrations for columns of type xml [t.xml :xml_col1,:xml_col2]
|
154
|
+
|
155
|
+
2008/03/10 (IBM_DB adapter 0.9.3, driver 0.9.3):
|
156
|
+
- Resolved the issue of truncation of output when stored procedure was called
|
157
|
+
|
158
|
+
2007/11/30 (IBM_DB adapter 0.9.2, driver 0.9.1):
|
159
|
+
- Lifted index length limitation (18 chars) and fixed multiple index creation
|
160
|
+
- Fixed [#13294] limit/offset breaks subselect in db2 adapter
|
161
|
+
- Fixed error handling for metadata retrieval (tables, columns, indexes)
|
162
|
+
|
163
|
+
2007/11/07 (IBM_DB adapter 0.9.1, driver 0.9.1):
|
164
|
+
- Fixed ibm_db driver VC80 runtime issue on Windows
|
165
|
+
|
166
|
+
2007/09/28 (IBM_DB adapter 0.9.0, driver 0.9.0):
|
167
|
+
- Fixed ibm_db gem 0.8.5 incompatibility with DB2 CLI 9.1 FP3 and below
|
168
|
+
|
169
|
+
2007/09/13 (IBM_DB adapter 0.8.5, driver 0.8.5):
|
170
|
+
- Fixed Ruby driver crash on Windows Vista [#13357]
|
171
|
+
|
172
|
+
2007/07/05 (IBM_DB adapter 0.8.0, driver 0.7.0):
|
173
|
+
- Support for Informix Dynamic Server 11.10
|
174
|
+
- New driver method get_last_serial_value to retrieve last inserted serial
|
175
|
+
value for Informix Dynamic Server
|
176
|
+
|
177
|
+
2007/06/19 (IBM_DB adapter 0.7.5, driver 0.6.0):
|
178
|
+
- Driver code (ibm_db.c) remains at the same level: 0.6.0 (no changes)
|
179
|
+
- Fixed client attributes initialization on connection setup [11264]
|
180
|
+
- Fixed rake db:schema:dump native data types limits incompatible with table create
|
181
|
+
|
182
|
+
2007/06/01 (IBM_DB adapter 0.7.0, driver 0.6.0):
|
183
|
+
- Driver code (ibm_db.c) remains at the same level: 0.6.0 (no changes)
|
184
|
+
- Fixed remaining failure on {:null => true} option for XML data type [#10877]
|
185
|
+
- Fixed handling of {:id => false} option during table creation in DB2 for zOS
|
186
|
+
- Fixed handle_lobs failures in table creation for has_many/belongs_to [#10701]
|
187
|
+
- Fixe db2-i5-zOS.yaml content (removed inadvertent tab) [#11234]
|
188
|
+
|
189
|
+
2007/05/10 (IBM_DB adapter 0.6.5, driver 0.6.0):
|
190
|
+
- Driver code (ibm_db.c) remains at the same level: 0.6.0 (no changes)
|
191
|
+
- Fixed regression for reconnect after being inactive (connection recycle)
|
192
|
+
- Fixed rake db:schema:load failures on boolean data type [#10683]
|
193
|
+
- Fixed XML default option (:null => true for XML data type) [#10754]
|
194
|
+
- Fixed DB2 for zOS version 9 handling of column changes for DEFAULT NULL
|
195
|
+
|
196
|
+
2007/04/30 (0.6.0):
|
197
|
+
- Support for remote connections to DB2 Universal Database on z/OS version 9
|
198
|
+
- Support for result set pagination via ActiveRecord add_limit_offset! method
|
199
|
+
for DB2 Universal Database on z/OS and i5/OS
|
200
|
+
- Defect fixes
|
201
|
+
- Improved documentation
|
202
|
+
|
203
|
+
2007/04/20 (0.4.6):
|
204
|
+
- Fixed XML columns creation default value (NOT NULL)
|
205
|
+
- Fixed border case for IS NULL in where clauses
|
206
|
+
- Improved documentation (connection attributes)
|
207
|
+
|
208
|
+
2007/04/20 (0.4.5):
|
209
|
+
- Fixed reconnect problems: driver (IBM_DB::active) and adapter (active)
|
210
|
+
- Client connection attribute rename (app_user to replace user)
|
211
|
+
- Improved support for ROWID data type (DB2 for zOS version 8 and 9)
|
212
|
+
|
213
|
+
2007/03/21 (0.4.0):
|
214
|
+
- Support added for remote connectivity to DB2 zOS version 8
|
215
|
+
- Support added for remote connectivity to DB2 i5 v5r3 and v5r4
|
216
|
+
- Improved migration support (added change_column method)
|
217
|
+
- Support for setting and retrieving values for client attributes (user,
|
218
|
+
account, application, workstation)
|
219
|
+
|
220
|
+
2006/10/31 (0.2.0):
|
221
|
+
- Significant performance improvements
|
222
|
+
- Improved stored procedure support at driver level
|
223
|
+
- Added support for Large Object data types (LOBs) greater than 32K (BLOB, CLOB, XML) in size
|
224
|
+
- Added XML data type support for native storage of XML documents
|
225
|
+
- Significant quality improvements, through many bug fixes in the driver and adapter
|
226
|
+
- Improved migration support (added add_column and remove_column methods)
|
227
|
+
|
228
|
+
2006/06/07 (0.1.0):
|
229
|
+
|
230
|
+
- Fixed compatibility issue with other adapters
|
231
|
+
- If a schema is omitted in database.yml, the username is now used as default schema
|
232
|
+
- Introduced descriptive CLI error messages when a connection or an execute statement fails
|
233
|
+
- Introduced check against schema in method 'indexes'
|
data/LICENSE
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
Copyright (c) 2006 - 2015 IBM Corporation
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the "Software"),
|
5
|
+
to deal in the Software without restriction, including without limitation
|
6
|
+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
7
|
+
and/or sell copies of the Software, and to permit persons to whom the Software
|
8
|
+
is furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included
|
11
|
+
in all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
14
|
+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
15
|
+
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
16
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
17
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
18
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/MANIFEST
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
CHANGES
|
2
|
+
README
|
3
|
+
LICENSE
|
4
|
+
ext/extconf.rb
|
5
|
+
ext/ibm_db.c
|
6
|
+
ext/ruby_ibm_db.h
|
7
|
+
lib/IBM_DB.rb
|
8
|
+
lib/linux32/ibm_db.so
|
9
|
+
lib/mswin32/ibm_db.so
|
10
|
+
lib/active_record/connection_adapters/ibm_db_adapter.rb
|
11
|
+
lib/active_record/vendor/db2-i5-zOS.yaml
|
12
|
+
test/activerecord/native_ibm_db/connection.rb
|
13
|
+
test/ibm_db_test.rb
|
14
|
+
MANIFEST
|
@@ -0,0 +1,39 @@
|
|
1
|
+
+-------------------------------------------+-------------------------------------------+
|
2
|
+
| README for Parameterized Queries Support in Ruby-on-Rails/ Activerecord applications |
|
3
|
+
+-------------------------------------------+-------------------------------------------+
|
4
|
+
|
5
|
+
Enabling Usage of Parameterized Queries with Ruby-on-Rails / Activerecord applications
|
6
|
+
======================================================================================
|
7
|
+
To enable usage of parameterized SQL queries with Ruby-on-Rails/ActiveRecord applications, in your connection configuration (database.yml), set "parameterized" to true. By default "parameterized" is false (if not specified). A sample database.yml file showing development section with parameterized queries enabled looks as below
|
8
|
+
|
9
|
+
development:
|
10
|
+
adapter: ibm_db
|
11
|
+
username: db2inst1
|
12
|
+
password: secret
|
13
|
+
database: devdb
|
14
|
+
#schema: db2inst1
|
15
|
+
#host: localhost
|
16
|
+
#port: 50000
|
17
|
+
#account: my_account
|
18
|
+
#app_user: my_app_user
|
19
|
+
#application: my_application
|
20
|
+
#workstation: my_workstation
|
21
|
+
parameterized: true
|
22
|
+
|
23
|
+
Similarly for the other sections (test/production) of the database.yml file set "parameterized" to true to enable usage of parameterized SQL queries
|
24
|
+
|
25
|
+
Supported Activerecord Versions
|
26
|
+
===============================
|
27
|
+
Activerecord-2.3.3, Activerecord-2.3.4, Activerecord-2.3.5
|
28
|
+
|
29
|
+
Supported Operating Systems and Databases
|
30
|
+
=========================================
|
31
|
+
Refer the main README
|
32
|
+
|
33
|
+
Feedback
|
34
|
+
========
|
35
|
+
Your feedback is very much appreciated and expected through Rubyforge:
|
36
|
+
- rubyibm project: http://rubyforge.org/projects/rubyibm/
|
37
|
+
- rubyibm forum: http://rubyforge.org/forum/?group_id=2361
|
38
|
+
- rubyibm bug reports: http://rubyforge.org/tracker/?group_id=2361
|
39
|
+
- IBM_DB developers: rubyibm-developers@rubyforge.org
|
data/README
ADDED
@@ -0,0 +1,225 @@
|
|
1
|
+
=====================================================================
|
2
|
+
README for the IBM_DB Adapter (2.5.26) and Driver (2.5.26) (2015/04/08)
|
3
|
+
For ActiveRecord Version >= 1.15.5 (and Rails >= 1.2.5)
|
4
|
+
=====================================================================
|
5
|
+
|
6
|
+
Supported Operating Systems
|
7
|
+
============================
|
8
|
+
- Linux 32/64 bit
|
9
|
+
- Microsoft Windows 32 bit
|
10
|
+
- IBM AIX 32/64 bit
|
11
|
+
- HP-UX 32/64 bit
|
12
|
+
- Sun Solaris 32/64 bit
|
13
|
+
|
14
|
+
|
15
|
+
Supported Databases
|
16
|
+
====================
|
17
|
+
- IBM DB2 Universal Database on Linux/Unix/Windows versions 9 Fixpak2 and above
|
18
|
+
- Remote connections to IBM DB2 Universal Database on i5/OS versions V5R3 and V5R4.
|
19
|
+
Please ensure PTF SI27358 (includes SI27250) is installed in i5/OS version 5R3 and
|
20
|
+
and PTF SI27256 is installed while using i5/OS version 5R4.
|
21
|
+
- Remote connections to IBM DB2 Universal Database on z/OS version 8, 9 and 10
|
22
|
+
- Informix Dynamic Server 11.10 and beyond.
|
23
|
+
Please ensure that the IBM DataServer Viper 2 client is installed.
|
24
|
+
|
25
|
+
|
26
|
+
Installing the IBM_DB adapter and driver as a Ruby gem
|
27
|
+
=======================================================
|
28
|
+
The IBM_DB gem is an ActiveRecord adapter. Installing the IBM_DB adapter and driver as a gem enables any application in the
|
29
|
+
Ruby environment, including Rails, to interact with IBM data servers.
|
30
|
+
|
31
|
+
Note : - 1) If using activerecord version below 2.0 then it requires that the ibm_db adapter be registered with the list of connection adapters by manually adding ibm_db at line 77 (approx) in the file activerecord.rb (GEM_HOME\activerecord-<version>\lib\).
|
32
|
+
|
33
|
+
2) The IBM_DB driver can also be built separately (from source) and used in direct API calls.
|
34
|
+
|
35
|
+
1. Windows platforms:
|
36
|
+
=====================
|
37
|
+
INSTALL (as Ruby gem)
|
38
|
+
To remove previous gem version (optionally):
|
39
|
+
D:\>gem uninstall ibm_db
|
40
|
+
Successfully uninstalled ibm_db version 1.0.0
|
41
|
+
|
42
|
+
Example:
|
43
|
+
D:\>gem install ibm_db
|
44
|
+
Fetching: ibm_db-2.5.9-x86-mingw32.gem (100%)
|
45
|
+
Successfully installed ibm_db-2.5.9-x86-mingw32
|
46
|
+
1 gem installed
|
47
|
+
Installing ri documentation for ibm_db-2.5.9-x86-mingw32...
|
48
|
+
Installing RDoc documentation for ibm_db-2.5.9-x86-mingw32...
|
49
|
+
|
50
|
+
Note:
|
51
|
+
1) Currently Ruby-2.0 64-bit version on Windows is not supported as there are issues related to SQL definitions with the mingW compiler
|
52
|
+
[Details can be found here https://sourceforge.net/p/mingw/bugs/2041/ ].
|
53
|
+
Support will be enabled after the abive reported issue is resolved.
|
54
|
+
|
55
|
+
2)The manual step after install if using activerecord version below 2.0:
|
56
|
+
add ibm_db into GEM_HOME\1.8\gems\activerecord-1.15.3\lib\active_record.rb (Line 77)
|
57
|
+
|
58
|
+
2. Linux and Unix platforms:
|
59
|
+
============================
|
60
|
+
|
61
|
+
INSTALL (as Ruby gem)
|
62
|
+
To remove previous gem version (optionally):
|
63
|
+
$ gem uninstall ibm_db
|
64
|
+
Successfully uninstalled ibm_db version 0.6.0
|
65
|
+
|
66
|
+
Note: DB2 environment is required while using an arbitrary user account
|
67
|
+
(other than the DB2 install user account)
|
68
|
+
$ . /home/db2inst1/sqllib/db2profile
|
69
|
+
$ export IBM_DB_HOME=DB2HOME (eg. /home/db2inst1/sqllib or /opt/ibm/db2/v9.5)
|
70
|
+
$ gem install ibm_db
|
71
|
+
Building native extensions. This could take a while...
|
72
|
+
Successfully installed ibm_db-2.5.9
|
73
|
+
1 gem installed
|
74
|
+
Installing ri documentation for ibm_db-2.5.9...
|
75
|
+
Installing RDoc documentation for ibm_db-2.5.9...
|
76
|
+
|
77
|
+
BUILD (optionally) ibm_db gem from sources (ibm_db-x.x.x.tar.gz):
|
78
|
+
1. Download source from Rubyforge
|
79
|
+
http://rubyforge.org/frs/?group_id=2361
|
80
|
+
2. Build gem from specification (IBM_DB.gemspec)
|
81
|
+
$ cd IBM_DB_Adapter/ibm_db
|
82
|
+
$ gem build IBM_DB.gemspec
|
83
|
+
|
84
|
+
Note: The manual step after install if using activerecord version below 2.0:
|
85
|
+
add ibm_db into GEM_HOME\1.8\gems\activerecord-1.15.3\lib\active_record.rb (Line 77)
|
86
|
+
|
87
|
+
TEST (simple gem install verification)
|
88
|
+
======================================
|
89
|
+
$ rails new myApp -d ibm_db
|
90
|
+
$ cd myApp
|
91
|
+
$ rails generate scaffold Wood name:string price:float
|
92
|
+
$ vi config/database.yml
|
93
|
+
$ rake db:migrate
|
94
|
+
$ rails console #rails server
|
95
|
+
|
96
|
+
Instructions for building and installing the IBM_DB driver from source
|
97
|
+
=======================================================================
|
98
|
+
Building the driver manually as described below is not required if the install
|
99
|
+
process above has been pursued. This manual procedure is in fact automated
|
100
|
+
on Linux and UNIX platforms by the IBM_DB gem install, but is presented
|
101
|
+
here only for reference.
|
102
|
+
|
103
|
+
Prerequisites:
|
104
|
+
Install Ruby from:
|
105
|
+
http://rubyforge.org
|
106
|
+
|
107
|
+
Setup the environment
|
108
|
+
|
109
|
+
Linux and Unix platforms:
|
110
|
+
Note: commands may vary depending on the shell used
|
111
|
+
- To setup DB2 environment while using an arbitrary user account
|
112
|
+
(other than the DB2 install user account):
|
113
|
+
Example:
|
114
|
+
$ . /home/db2inst1/sqllib/db2profile
|
115
|
+
|
116
|
+
- To compile and link with DB2 client libraries:
|
117
|
+
$ export IBM_DB_HOME=DB2HOME (eg. /home/db2inst1/sqllib or /opt/ibm/db2/v9.5)
|
118
|
+
|
119
|
+
Windows platforms:
|
120
|
+
- Set ruby devkit environment:
|
121
|
+
- To compile and link with DB2 client libraries:
|
122
|
+
$ set IBM_DB_HOME=DB2HOME (eg. C:\Program Files\IBM\SQLLIB)
|
123
|
+
|
124
|
+
Build the driver:
|
125
|
+
- $ cd rubyibm_source/IBM_DB_Adapter/ibm_db/ext
|
126
|
+
- $ ruby extconf.rb
|
127
|
+
- $ make
|
128
|
+
|
129
|
+
Build the ibm_db gem
|
130
|
+
- $ cp rubyibm_source/IBM_DB_Adapter/ibm_db/ext/ibm_db.so rubyibm_source/IBM_DB_Adapter/ibm_db/lib
|
131
|
+
# Not on windows separate binaries are generated for 1.8 and 1.9 version of ruby
|
132
|
+
# and placed under rb18x and rb19x directories respectively. The file ibm_db_mswin32.rb is renamed to ibm_db.rb to ensure proper binary is loaded based on runtime
|
133
|
+
# You will need to similarly ensure that the generated binary is placed on rb18x or rb19x directory under lib based on ruby version being used
|
134
|
+
- $ cd rubyibm_source/IBM_DB_Adapter/ibm_db
|
135
|
+
- $ gem build IBM_DB.gemspec
|
136
|
+
|
137
|
+
Running tests
|
138
|
+
=============
|
139
|
+
Testing the IBM_DB Adapter
|
140
|
+
|
141
|
+
1) a) Copy the files under test directory of ibm_db gem to the test directory of Activerecord following the same directory structure.
|
142
|
+
These files contain modifications in some test files of AR suite to handle ibm_db specifics. Hence make sure these files are replaced in the AR test suite properly.
|
143
|
+
b) Rename warhouse-things.yml to warehouse_things.yml under fixtures directory
|
144
|
+
2) Edit the Rakefile to include ibm_db in list of adapters
|
145
|
+
%w( mysql mysql2 postgresql sqlite3 sqlite3_mem firebird db2 oracle sybase openbase ibm_db frontbase jdbcmysql jdbcpostgresql jdbcsqlite3 jdbcderby jdbch2 jdbchsqldb )
|
146
|
+
3) Configure the connection information in test/config.yml for ibm_db
|
147
|
+
4) run the test suite - rake test_ibm_db
|
148
|
+
|
149
|
+
Running IBM_DB driver test suite
|
150
|
+
|
151
|
+
1) Copy over the test directory under source to lib directory of installed ibm_db under $GEM_HOME
|
152
|
+
2) Edit config.yml file to provide database connection information
|
153
|
+
3) Run the test suite
|
154
|
+
$ rake onlytests
|
155
|
+
4) To run single test
|
156
|
+
export SINGLE_RUBY_TEST=<test file name> #Eg: export SINGLE_RUBY_TEST=test_000_PrepareDb.rb
|
157
|
+
rake onlytests
|
158
|
+
|
159
|
+
Limitations and known problems
|
160
|
+
==============================
|
161
|
+
- ActiveRecord remove_column method is not supported for DB2 zOS
|
162
|
+
- The driver returns an error when you try to insert a TIMESTAMP value into a DATE column.
|
163
|
+
To fix this, please ensure that the following configuration keyword PATCH2=58 is set
|
164
|
+
in the COMMON section of your DB2 CLI initialization file (db2cli.ini):
|
165
|
+
- set: db2 UPDATE CLI CFG FOR SECTION COMMON USING PATCH2 58
|
166
|
+
- verify: db2 GET CLI CFG FOR SECTION COMMON
|
167
|
+
Please refer to http://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2.udb.apdv.cli.doc/doc/c0007882.htm
|
168
|
+
for more information.
|
169
|
+
- The behaviour of ActiveRecord::Base.find(:first) without an :order attribute can be unpredictable.
|
170
|
+
The first record (i.e. the record with the minimum id) may be not retrieved. In a relational model,
|
171
|
+
the order of the rows returned is unpredictable and independent of the order of insertion.
|
172
|
+
This issue may be addressed in a future release.
|
173
|
+
- Rails applications on DB2 9 require the APPLHEAPSZ database configuration parameter to be
|
174
|
+
set to or above 1024. You will need to set this parameter for each database for which you will be
|
175
|
+
running DB2 on Rails applications. Following is the command syntax for updating the
|
176
|
+
applheapsz parameter:
|
177
|
+
> db2 update db cfg for <database_name> using APPLHEAPSZ 1024
|
178
|
+
To enable this parameter, you need to restart your DB2 instance.
|
179
|
+
- If you see connectivity issues with Informix Dynamic Server, please ensure that the server is configured to accept DRDA connections.
|
180
|
+
Please refer to http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp?topic=/com.ibm.admin.doc/admin154.htm for more information.
|
181
|
+
- IBM_DB is not supported on JRuby. As stated in the JRuby Wiki, "Basics of Getting JRuby Running":
|
182
|
+
'You may install other gems, but keep in mind that libraries with C extension dependencies
|
183
|
+
will not work in JRuby.' http://www.headius.com/jrubywiki/index.php/Getting_Started
|
184
|
+
The IBM_DB adapter relies on IBM_DB driver (C extension) and the IBM Driver for ODBC and
|
185
|
+
CLI to access databases on IBM data servers. Alternatively, you can either use the regular C
|
186
|
+
implementation of Ruby, or use ActiveRecord-JDBC adapter to access databases.
|
187
|
+
- When using ActiveRecord-2.1.0 it requires that ActiveRecord be patched, with the patch in the link below:
|
188
|
+
http://rails.lighthouseapp.com/attachments/26975/association_preloading.diff
|
189
|
+
The patch is required because, ActiveRecord 2.1.0 generates a non-standard SQL identifier,while preloading has_and_belongs_to_many associations,
|
190
|
+
which standard compliant databases like DB2 do not support. The bug report, against ActiveRecord, can be found in the link below
|
191
|
+
http://rails.lighthouseapp.com/projects/8994/tickets/394-patch-fixed-non-standard-sql-generated-by-preloading-has_and_belongs_to_many-associations
|
192
|
+
- The following tests from the ActiveRecord 2.1.0 test suite with ibm_db gem 0.10.0 are expected to fail on DB2 LUW
|
193
|
+
- test_read_attributes_before_type_cast_on_datetime
|
194
|
+
- test_to_xml
|
195
|
+
- test_native_types
|
196
|
+
- test_counting
|
197
|
+
- test_counting_with_column_name_and_hash
|
198
|
+
- test_counting_with_empty_hash_conditions
|
199
|
+
- test_counting_with_single_conditions
|
200
|
+
- test_counting_with_single_hash
|
201
|
+
Note :- 1) The test cases from HasManyAssociations (4-8) above are found failing only when run as part of
|
202
|
+
the complete suite. However they pass when run standalone.
|
203
|
+
2) Also there are two test cases (test_validate_uniqueness_with_non_standard_table_names, test_update_all_with_non_standard_table_name)which run against table with non-standard name. Given that DB2/IDS is standard compliant these test cases are expected to fail.
|
204
|
+
To have these test cases passing rename the fixtures file warehouse-things to warehouse_things.
|
205
|
+
- Usage with Rails-3.0.3/Rails-3.0.4
|
206
|
+
- To use with Rails-3.0.3/4 patch latest Arel with the patch available at https://gist.github.com/814491
|
207
|
+
|
208
|
+
Unicode Support
|
209
|
+
===============
|
210
|
+
- Available only with Ruby version 1.9 and above
|
211
|
+
- Data returned from the driver will be in UTF8 encoding format.
|
212
|
+
- The input data to the driver can be in any Ruby supported encoding format.
|
213
|
+
|
214
|
+
To Do
|
215
|
+
====
|
216
|
+
- Support ActiveRecord remove_column method for DB2 zOS version 9
|
217
|
+
|
218
|
+
|
219
|
+
Feedback
|
220
|
+
========
|
221
|
+
Your feedback is very much appreciated and expected through Rubyforge:
|
222
|
+
- rubyibm project: http://rubyforge.org/projects/rubyibm/
|
223
|
+
- rubyibm forum: http://rubyforge.org/forum/?group_id=2361
|
224
|
+
- rubyibm bug reports: http://rubyforge.org/tracker/?group_id=2361
|
225
|
+
- IBM_DB developers: rubyibm-developers@rubyforge.org
|