intentmedia-activerecord-jdbc-adapter 1.1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. data/History.txt +404 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.txt +181 -0
  4. data/Rakefile +10 -0
  5. data/lib/active_record/connection_adapters/derby_adapter.rb +1 -0
  6. data/lib/active_record/connection_adapters/h2_adapter.rb +1 -0
  7. data/lib/active_record/connection_adapters/hsqldb_adapter.rb +1 -0
  8. data/lib/active_record/connection_adapters/informix_adapter.rb +1 -0
  9. data/lib/active_record/connection_adapters/jdbc_adapter.rb +1 -0
  10. data/lib/active_record/connection_adapters/jndi_adapter.rb +1 -0
  11. data/lib/active_record/connection_adapters/mssql_adapter.rb +1 -0
  12. data/lib/active_record/connection_adapters/mysql2_adapter.rb +1 -0
  13. data/lib/active_record/connection_adapters/mysql_adapter.rb +1 -0
  14. data/lib/active_record/connection_adapters/oracle_adapter.rb +1 -0
  15. data/lib/active_record/connection_adapters/postgresql_adapter.rb +1 -0
  16. data/lib/active_record/connection_adapters/sqlite3_adapter.rb +1 -0
  17. data/lib/activerecord-jdbc-adapter.rb +8 -0
  18. data/lib/arel/engines/sql/compilers/db2_compiler.rb +9 -0
  19. data/lib/arel/engines/sql/compilers/derby_compiler.rb +6 -0
  20. data/lib/arel/engines/sql/compilers/h2_compiler.rb +6 -0
  21. data/lib/arel/engines/sql/compilers/hsqldb_compiler.rb +15 -0
  22. data/lib/arel/engines/sql/compilers/jdbc_compiler.rb +6 -0
  23. data/lib/arel/engines/sql/compilers/mssql_compiler.rb +46 -0
  24. data/lib/arel/visitors/compat.rb +13 -0
  25. data/lib/arel/visitors/db2.rb +17 -0
  26. data/lib/arel/visitors/derby.rb +21 -0
  27. data/lib/arel/visitors/hsqldb.rb +26 -0
  28. data/lib/arel/visitors/sql_server.rb +46 -0
  29. data/lib/arjdbc.rb +29 -0
  30. data/lib/arjdbc/db2.rb +2 -0
  31. data/lib/arjdbc/db2/adapter.rb +413 -0
  32. data/lib/arjdbc/derby.rb +7 -0
  33. data/lib/arjdbc/derby/adapter.rb +348 -0
  34. data/lib/arjdbc/derby/connection_methods.rb +18 -0
  35. data/lib/arjdbc/discover.rb +92 -0
  36. data/lib/arjdbc/firebird.rb +2 -0
  37. data/lib/arjdbc/firebird/adapter.rb +131 -0
  38. data/lib/arjdbc/h2.rb +4 -0
  39. data/lib/arjdbc/h2/adapter.rb +36 -0
  40. data/lib/arjdbc/h2/connection_methods.rb +12 -0
  41. data/lib/arjdbc/hsqldb.rb +4 -0
  42. data/lib/arjdbc/hsqldb/adapter.rb +184 -0
  43. data/lib/arjdbc/hsqldb/connection_methods.rb +14 -0
  44. data/lib/arjdbc/informix.rb +3 -0
  45. data/lib/arjdbc/informix/adapter.rb +138 -0
  46. data/lib/arjdbc/informix/connection_methods.rb +10 -0
  47. data/lib/arjdbc/jdbc.rb +2 -0
  48. data/lib/arjdbc/jdbc/adapter.rb +285 -0
  49. data/lib/arjdbc/jdbc/callbacks.rb +44 -0
  50. data/lib/arjdbc/jdbc/column.rb +38 -0
  51. data/lib/arjdbc/jdbc/compatibility.rb +51 -0
  52. data/lib/arjdbc/jdbc/connection.rb +128 -0
  53. data/lib/arjdbc/jdbc/connection_methods.rb +16 -0
  54. data/lib/arjdbc/jdbc/core_ext.rb +24 -0
  55. data/lib/arjdbc/jdbc/discover.rb +18 -0
  56. data/lib/arjdbc/jdbc/driver.rb +44 -0
  57. data/lib/arjdbc/jdbc/extension.rb +47 -0
  58. data/lib/arjdbc/jdbc/java.rb +14 -0
  59. data/lib/arjdbc/jdbc/jdbc.rake +127 -0
  60. data/lib/arjdbc/jdbc/missing_functionality_helper.rb +87 -0
  61. data/lib/arjdbc/jdbc/quoted_primary_key.rb +28 -0
  62. data/lib/arjdbc/jdbc/railtie.rb +9 -0
  63. data/lib/arjdbc/jdbc/rake_tasks.rb +10 -0
  64. data/lib/arjdbc/jdbc/require_driver.rb +16 -0
  65. data/lib/arjdbc/jdbc/type_converter.rb +127 -0
  66. data/lib/arjdbc/mimer.rb +2 -0
  67. data/lib/arjdbc/mimer/adapter.rb +142 -0
  68. data/lib/arjdbc/mssql.rb +4 -0
  69. data/lib/arjdbc/mssql/adapter.rb +472 -0
  70. data/lib/arjdbc/mssql/connection_methods.rb +30 -0
  71. data/lib/arjdbc/mssql/limit_helpers.rb +92 -0
  72. data/lib/arjdbc/mssql/tsql_helper.rb +61 -0
  73. data/lib/arjdbc/mysql.rb +4 -0
  74. data/lib/arjdbc/mysql/adapter.rb +416 -0
  75. data/lib/arjdbc/mysql/connection_methods.rb +27 -0
  76. data/lib/arjdbc/oracle.rb +3 -0
  77. data/lib/arjdbc/oracle/adapter.rb +412 -0
  78. data/lib/arjdbc/oracle/connection_methods.rb +11 -0
  79. data/lib/arjdbc/postgresql.rb +4 -0
  80. data/lib/arjdbc/postgresql/adapter.rb +579 -0
  81. data/lib/arjdbc/postgresql/connection_methods.rb +21 -0
  82. data/lib/arjdbc/sqlite3.rb +4 -0
  83. data/lib/arjdbc/sqlite3/adapter.rb +381 -0
  84. data/lib/arjdbc/sqlite3/connection_methods.rb +34 -0
  85. data/lib/arjdbc/sybase.rb +2 -0
  86. data/lib/arjdbc/sybase/adapter.rb +46 -0
  87. data/lib/arjdbc/version.rb +8 -0
  88. data/lib/generators/jdbc/jdbc_generator.rb +9 -0
  89. data/lib/jdbc_adapter.rb +2 -0
  90. data/lib/jdbc_adapter/rake_tasks.rb +3 -0
  91. data/lib/jdbc_adapter/version.rb +3 -0
  92. data/lib/pg.rb +26 -0
  93. data/rails_generators/jdbc_generator.rb +15 -0
  94. data/rails_generators/templates/config/initializers/jdbc.rb +7 -0
  95. data/rails_generators/templates/lib/tasks/jdbc.rake +8 -0
  96. data/rakelib/compile.rake +25 -0
  97. data/rakelib/db.rake +19 -0
  98. data/rakelib/package.rake +91 -0
  99. data/rakelib/rails.rake +41 -0
  100. data/rakelib/test.rake +81 -0
  101. data/src/java/arjdbc/derby/DerbyModule.java +322 -0
  102. data/src/java/arjdbc/h2/H2RubyJdbcConnection.java +70 -0
  103. data/src/java/arjdbc/informix/InformixRubyJdbcConnection.java +74 -0
  104. data/src/java/arjdbc/jdbc/AdapterJavaService.java +66 -0
  105. data/src/java/arjdbc/jdbc/JdbcConnectionFactory.java +36 -0
  106. data/src/java/arjdbc/jdbc/RubyJdbcConnection.java +1305 -0
  107. data/src/java/arjdbc/jdbc/SQLBlock.java +48 -0
  108. data/src/java/arjdbc/mssql/MssqlRubyJdbcConnection.java +127 -0
  109. data/src/java/arjdbc/mysql/MySQLModule.java +134 -0
  110. data/src/java/arjdbc/mysql/MySQLRubyJdbcConnection.java +87 -0
  111. data/src/java/arjdbc/oracle/OracleRubyJdbcConnection.java +85 -0
  112. data/src/java/arjdbc/postgresql/PostgresqlRubyJdbcConnection.java +57 -0
  113. data/src/java/arjdbc/sqlite3/Sqlite3RubyJdbcConnection.java +64 -0
  114. data/test/abstract_db_create.rb +124 -0
  115. data/test/activerecord/connection_adapters/type_conversion_test.rb +31 -0
  116. data/test/activerecord/connections/native_jdbc_mysql/connection.rb +25 -0
  117. data/test/db/db2.rb +11 -0
  118. data/test/db/derby.rb +12 -0
  119. data/test/db/h2.rb +11 -0
  120. data/test/db/hsqldb.rb +13 -0
  121. data/test/db/informix.rb +11 -0
  122. data/test/db/jdbc.rb +11 -0
  123. data/test/db/jndi_config.rb +40 -0
  124. data/test/db/logger.rb +3 -0
  125. data/test/db/mssql.rb +9 -0
  126. data/test/db/mysql.rb +10 -0
  127. data/test/db/oracle.rb +34 -0
  128. data/test/db/postgres.rb +9 -0
  129. data/test/db/sqlite3.rb +11 -0
  130. data/test/db2_simple_test.rb +66 -0
  131. data/test/derby_migration_test.rb +68 -0
  132. data/test/derby_multibyte_test.rb +12 -0
  133. data/test/derby_simple_test.rb +99 -0
  134. data/test/generic_jdbc_connection_test.rb +29 -0
  135. data/test/h2_simple_test.rb +41 -0
  136. data/test/has_many_through.rb +79 -0
  137. data/test/helper.rb +5 -0
  138. data/test/hsqldb_simple_test.rb +6 -0
  139. data/test/informix_simple_test.rb +48 -0
  140. data/test/jdbc_common.rb +25 -0
  141. data/test/jndi_callbacks_test.rb +40 -0
  142. data/test/jndi_test.rb +25 -0
  143. data/test/manualTestDatabase.rb +191 -0
  144. data/test/models/add_not_null_column_to_table.rb +12 -0
  145. data/test/models/auto_id.rb +18 -0
  146. data/test/models/data_types.rb +28 -0
  147. data/test/models/entry.rb +43 -0
  148. data/test/models/mixed_case.rb +25 -0
  149. data/test/models/reserved_word.rb +18 -0
  150. data/test/models/string_id.rb +18 -0
  151. data/test/models/validates_uniqueness_of_string.rb +19 -0
  152. data/test/mssql_db_create_test.rb +26 -0
  153. data/test/mssql_identity_insert_test.rb +19 -0
  154. data/test/mssql_legacy_types_test.rb +58 -0
  155. data/test/mssql_limit_offset_test.rb +136 -0
  156. data/test/mssql_multibyte_test.rb +18 -0
  157. data/test/mssql_simple_test.rb +55 -0
  158. data/test/mysql_db_create_test.rb +27 -0
  159. data/test/mysql_info_test.rb +123 -0
  160. data/test/mysql_multibyte_test.rb +10 -0
  161. data/test/mysql_nonstandard_primary_key_test.rb +42 -0
  162. data/test/mysql_simple_test.rb +49 -0
  163. data/test/oracle_simple_test.rb +18 -0
  164. data/test/oracle_specific_test.rb +83 -0
  165. data/test/pick_rails_version.rb +3 -0
  166. data/test/postgres_db_create_test.rb +32 -0
  167. data/test/postgres_drop_db_test.rb +16 -0
  168. data/test/postgres_mixed_case_test.rb +29 -0
  169. data/test/postgres_nonseq_pkey_test.rb +38 -0
  170. data/test/postgres_reserved_test.rb +22 -0
  171. data/test/postgres_schema_search_path_test.rb +44 -0
  172. data/test/postgres_simple_test.rb +65 -0
  173. data/test/postgres_table_alias_length_test.rb +15 -0
  174. data/test/simple.rb +546 -0
  175. data/test/sqlite3_simple_test.rb +233 -0
  176. data/test/sybase_jtds_simple_test.rb +28 -0
  177. metadata +259 -0
data/History.txt ADDED
@@ -0,0 +1,404 @@
1
+ == 1.1.1
2
+
3
+ - Arel 2.0.7 compatibility: fix bugs arising from use of Arel 2.0.7 +
4
+ ArJdbc 1.1.0.
5
+ - Gracefully handle changes to limit in Arel's AST
6
+ - Avoid conflict with Arel 2.0.7's mssql visitor
7
+ - Upgrade to PostgreSQL 9.0.801 JDBC drivers (David Kellum)
8
+
9
+ == 1.1.0 (12/09/10)
10
+
11
+ - Don't narrow platform to '-java' only: revert back to 0.9.2 where
12
+ ar-jdbc can be installed under any Ruby (for easier Bundler/Warbler
13
+ usage and less confusion on rubygems.org).
14
+ - Upgrade MySQL execute code to use RETURN_GENERATED_KEYS.
15
+ - Upgrade to MySQL driver version 5.1.13
16
+ - Add multi-statement support, idea from oruen. For databases that
17
+ support it, you can now do:
18
+ results = Model.connection.execute("select 1; select 2")
19
+ and receive back an array of multiple result set arrays. For use with
20
+ MySQL, you need to add
21
+ options:
22
+ allowMultiQueries: true
23
+ in database.yml.
24
+ - ACTIVERECORD_JDBC-144: Fix limits appearing in schema dump for some
25
+ datatypes (Uwe Kubosch)
26
+ - Fixes for DB2 limit/offset
27
+ - Fix rake db:create for 'jdbc' adapter (Joeri Samson)
28
+ - add create/drop database methods to h2 adapter (sahglie)
29
+ - Use connection getDatabaseProductName instead of getClass.getName
30
+ when detecting JNDI dialects (Denis Odorcic)
31
+ - ACTIVERECORD_JDBC-146: Fix create_table to not append encoding (Marc Slemko)
32
+ - All green on SQLite3 Rails master ActiveRecord tests
33
+ - ACTIVERECORD_JDBC-140: Sync postgres add/change column code from Rails master
34
+ - ACTIVERECORD_JDBC-139: TEXT/DATE on PostgreSQL should not have limits
35
+
36
+ == 1.0.3 (11/29/10)
37
+
38
+ - ACTIVERECORD_JDBC-143: Implement table_exists? fixing association
39
+ table names with schema prefixes
40
+ - Cleanup of column code for hsqldb (Denis Odorcic)
41
+ - Rails 3.0.3 support - add Arel 2 visitors for all adapters
42
+ - Fix MySQL date types to not have limits (Chris Lowder)
43
+ - ACTIVERECORD_JDBC-141: Better schema support in H2
44
+
45
+ == 1.0.2
46
+
47
+ - ACTIVERECORD_JDBC-134: Fix conflicting adapter/column superclasses
48
+ - ACTIVERECORD_JDBC-135: Fix regression on PG with boolean and :limit
49
+ - Slew of Derby fixes courtesy of Denis Odorcic
50
+
51
+ == 1.0.1
52
+
53
+ - Fix db:test:purge issue affecting all adapters in 1.0.0 due to
54
+ incorrect fix to JRUBY-5081 in 8b4b9c5
55
+
56
+ == 1.0.0
57
+
58
+ - Thanks to David Kellum, Dmitry Denisov, Dwayne Litzenberger, Gregor
59
+ Schmidt, James Walker, John Duff, Joshua Suggs, Nicholas J Kreucher,
60
+ Peter Donald, Geoff Longman, Uwe Kubosch, Youhei Kondou, Michael
61
+ Pitman, Alex B, and Ryan Bell for their contributions to this
62
+ release.
63
+ - BIG set of DB2 updates (Thanks Nick Kreucher)
64
+ - Deprecate jdbc_adapter/rake_tasks
65
+ - (1.0.0.beta1)
66
+ - Make database-specific extensions only load when necessary
67
+ - Allow for discovery of database extensions outside of ar-jdbc
68
+ proper. This should allow for custom database development to be
69
+ developed and released without relying on AR-JDBC core.
70
+ - Get AR's own tests running as close to 100% as possible. MySQL is
71
+ currently 100%, SQLite3 is close.
72
+ - JRUBY-4876: Bump up Derby's max index name length (Uwe Kubosch)
73
+ - (1.0.0.beta2)
74
+ - 98 commits since beta1
75
+ - MSSQL updates from dlitz and realityforge
76
+ - ACTIVERECORD_JDBC-131: Fix string slug issue for DB2 (Youhei Kondou)
77
+ - JRUBY-1642: Don't use H2 INFORMATION_SCHEMA in table or column
78
+ searches
79
+ - JRUBY-4972: Attempt to deal with type(0)/:limit => 0 by not setting
80
+ it808e213
81
+ - JRUBY-5040: Fix issue with limits on timestamps in MySQL
82
+ - JRUBY-3555: Allow setting Derby schema with 'schema:' option
83
+ - ACTIVERECORD_JDBC-98: Make sure we actuall raise an error when
84
+ inappropriately configured
85
+ - ACTIVERECORD_JDBC-112: Add schema dumper tests for already-fixed
86
+ MySQL type limits
87
+ - ACTIVERECORD_JDBC-113: Fix PG float precision issue
88
+ - ACTIVERECORD_JDBC-103: Fix decimal options for PG add/change column
89
+ (Michael Pitman)
90
+ - ACTIVERECORD_JDBC-127: Fix quoting of Date vs. Time(stamp) for
91
+ Oracle (Lenny Marks)
92
+ - Oracle: Sort out the NUMBER vs NUMBER(x) vs NUMBER(x,y) situation.
93
+ - JRUBY-3051: Think we finally got the PG mixed-case patches applied.
94
+ - JRUBY-5081: Consolidate code for dropping DB via postgres
95
+ - ACTIVERECORD_JDBC-101: Add override of LONGVARCHAR => CLOB for
96
+ informix
97
+ - ACTIVERECORD_JDBC-107: Fix MySQL update_all issue on AR 2.3
98
+ - ACTIVERECORD_JDBC-124: Filter out special _row_num column
99
+ - ACTIVERECORD_JDBC-126: Fix sql 2000 limit/offset per Michael Pitman
100
+ - ACTIVERECORD_JDBC-125: Add tweak to limit/offset code for HABTM
101
+ queries (alex b)
102
+ - ACTIVERECORD_JDBC-129: Don't have limits for text, binary or bit
103
+ fields
104
+ - (1.0.0 final)
105
+ - Fix a few more SQLite3 AR tests
106
+ - SQLite3: handle ":memory:" database
107
+ - Release new SQLite3 driver 3.6.14.2 and new Derby driver 10.6.2.1
108
+
109
+ == 0.9.7
110
+
111
+ - JRUBY-4781: Fix multiple database connection collision issue w/
112
+ Oracle
113
+ - ACTIVERECORD_JDBC-115: Support SAVEPOINTS for MySQL and PG so that
114
+ nested transactions can be faked
115
+ - ACTIVERECORD_JDBC-116: Handle schema.table better for MySQL (thanks
116
+ Dilshod Mukhtarov)
117
+ - Fix 'Wrong # of arguments (2 for 1)' issue with #create_database for
118
+ MySQL and AR 3.0
119
+ - SQLServer 2000 support (thanks Jay McGaffigan)
120
+
121
+ == 0.9.6
122
+
123
+ - The Oracle release!
124
+ - Oracle should be working much better with this release. Also updated
125
+ to work with Rails 3.
126
+ - Get all unit tests running cleanly on Oracle, fixing previous
127
+ datetime/timezone issues.
128
+ - ACTIVERECORD_JDBC-83: Add :sequence_start_value option to
129
+ create_table, following oracle_enhanced adapter
130
+ - ACTIVERECORD_JDBC-33: Don't double-quote table names in oracle
131
+ - ACTIVERECORD_JDBC-17: Fix Oracle primary keys so that /^NUMBER$/ => :integer
132
+ - Fix remaining blockers ACTIVERECORD_JDBC-82, JRUBY-3675,
133
+ ACTIVERECORD_JDBC-22, ACTIVERECORD_JDBC-27, JRUBY-4759
134
+
135
+ == 0.9.5
136
+
137
+ - The MSSQL release, courtesy of Mike Williams and Lonely
138
+ Planet.
139
+ - JRuby + AR-JDBC is now seen as the hassle-free way of using Rails
140
+ with SQLServer!
141
+ - Many fixes for MSSQL, including ACTIVERECORD_JDBC-18,
142
+ ACTIVERECORD_JDBC-41, ACTIVERECORD_JDBC-56, ACTIVERECORD_JDBC-94,
143
+ ACTIVERECORD_JDBC-99, JRUBY-3805, JRUBY-3793, JRUBY-4221
144
+ - All tests pass on Rails 3.0.0.beta3!
145
+
146
+ == 0.9.4
147
+
148
+ - ACTIVERECORD_JDBC-96: DB2 JdbcSpec cannot dump schema correctly
149
+ (Youhei Kondou)
150
+ - ACTIVERECORD_JDBC-97: Dont use Rails 3 deprecated constants (David
151
+ Calavera)
152
+ - Updates for rake db:schema:dump compatibility with Rails 2.3+ and
153
+ MySQL (Joakim Kolsj�)
154
+ - Rails 3.0.0.beta2 compatibility
155
+ - Return of Derby, H2, Hsqldb support (requires AR >= 3.0.0.beta2)
156
+
157
+ == 0.9.3
158
+
159
+ - Rails 3 compatibility
160
+ - PLEASE NOTE: ActiveRecord in Rails 3 has changed in a way that
161
+ doesn't allow non-standard DBs (such as the Derby and H2 embedded
162
+ DBs) to work. We're investigating the effort required to support
163
+ these databases and hope to have something for a future release.
164
+ - ACTIVERECORD_JDBC-91: Fix schema search path for PostgreSQL (Alex
165
+ Kuebo)
166
+ - ACTIVERECORD_JDBC-87: DB2 ID insert fix (Youhei Kondou)
167
+ - ACTIVERECORD_JDBC-90: MSSQL fix for DATEs (jlangenauer)
168
+ - ACTIVERECORD_JDBC-93: Fix string IDs for sqlite3, hsql/h2 (moser)
169
+ - ACTIVERECORD_JDBC-86: Fix Derby queries starting with VALUES (Dwayne Litzenberger)
170
+ - ACTIVERECORD_JDBC-95: Fix INSERT ... RETURNING for PostgreSQL
171
+
172
+ == 0.9.2
173
+
174
+ - The main, highly awaited fix for this release is a solution to the
175
+ rake db:create/db:drop issue. The main change is a new 'jdbc' rails
176
+ generator that should be run once to prepare a Rails application to
177
+ use JDBC. The upside of this generator is that you no longer will
178
+ need to alter database.yml for JDBC. See the README.txt for details.
179
+ - Cleanup and reconnect if errors occur during begin/rollback
180
+ (Jean-Dominique Morani, Christian Seiler)
181
+ - ACTIVERECORD_JDBC-1: Add #drop_database method for oracle (does the
182
+ same thing as recreate_database)
183
+ - Sqlite3 and MSSQL fixes (Jean-Dominique Morani)
184
+ - JRUBY-3512: Treat LONGVARCHAR as a CLOB for Mssql
185
+ - JRUBY-3624: Upgrade Derby to 10.5.3.0 and add native limit/offset
186
+ support (Christopher Saunders)
187
+ - JRUBY-3616: Fix postgres non-sequence primary keys (David Kellum)
188
+ - JRUBY-3669: Fix Oracle case with unconfigured schema (Dan Powell)
189
+ - Fixed quote_column_name of jdbc_oracle to accept numbers (Marcelo
190
+ Murad)
191
+ - Fix for mysql tables with non standard primary keys such that the
192
+ schema dump is correct (Nick Zalabak)
193
+ - MSSQL fixes from Mike Luu:
194
+ - add support for MSSQL uniqueidentifier datatype
195
+ - always quote strings using unicode identifier for MSSQL
196
+ - Changes primary_key generation to use always instead of by default
197
+ for DB2 (Amos King)
198
+ - Improves the SQLite adapter by fixing rename_column, change_column,
199
+ change_column_default, changing remove_column, and adding
200
+ remove_columns (Ryan Baumann)
201
+ - More oracle love courtesy Ben Browning and Jens Himmelreich
202
+ - JRUBY-3608: Add missing change_column_null method for postgres
203
+ - JRUBY-3508: Fix quoting of integer and float columns
204
+
205
+ == 0.9.1
206
+
207
+ - We did a lot of internal cleanup this release in the hopes of
208
+ simplifying the code and increasing performance.
209
+ - Many SQLite updates (thanks Nils Christian Haugen)
210
+ - JRUBY-2912: Fix MSSQL create/drop database (Joern Hartmann)
211
+ - JRUBY-2767: Mistake in selecting identity with H2/HSQLDB
212
+ - JRUBY-2884: jdbc_postgre.rb issue handling nil booleans (also a fix
213
+ for hsqldb/h2) + tests
214
+ - JRUBY-2995: activerecord jdbc derby adapter should quote columns
215
+ called 'year'
216
+ - JRUBY-2897: jdbc_postgre.rb needs microsecond support
217
+ - JRUBY-3282: Upgrade to derby 10.4.2.0 to allow unique constraints
218
+ with nullable columns
219
+ - Update h2 from 1.0.63 to 1.1.107 in driver
220
+ - JRUBY-3026: [Derby] Allow select/delete/update conditions with
221
+ comparison to NULL using '='
222
+ - JRUBY-2996: ...(actually this fixes only remaining issue of this bug
223
+ which was symbols making into quote were exploding
224
+ - JRUBY-2691: Update sybase driver to pass simple unit tests with jtds
225
+ and verify it works with the new dialect keyword. patch by Leigh
226
+ Kennedy
227
+ - Make :float type work on h2,hsql [returned as string]. Make :float
228
+ work on hsqldb (no paren value supported). Make REAL_TYPE just
229
+ return RubyFloat
230
+ - JRUBY-3222: Upgrade #type_to_sql to variation of AR 2.1.2 version
231
+ - Add patch supplied in JRUBY-3489 (patch by Jean-Dominique Morani)
232
+ - Various Oracle fixes by edsono
233
+ - JRUBY-2688: Don't hard-code MySQL connection character encoding to
234
+ utf8
235
+
236
+ == 0.9
237
+
238
+ - Now updated to support ActiveRecord 2.2. JNDI-based connections will
239
+ automatically connect/disconnect for every AR connection pool
240
+ checkout/checkin. For best results, set your pool: parameter >= the
241
+ actual maximum size of the JNDI connection pool. (We'll look at how
242
+ to eliminate the need to configure AR's pool in the future.)
243
+ - NEW! Informix support courtesy of Javier Fernandez-Ivern.
244
+ - Backport another Oracle CLOB issue, thanks Edson C�sar.
245
+ - Rubyforge #22018: chomp final trailing semicolon for oracle
246
+ - JRUBY-2848: Fix NPE error in set_native_database_types
247
+ - Rework oracle lob saving callback to be Rails 2.1 friendly (assist
248
+ from court3nay)
249
+ - JRUBY-2715: Add create/drop database methods to Postgres (Peter Williams)
250
+ - JRUBY-3183: Fix structure dump for Postgres (Ryan Bell)
251
+ - JRUBY-3184: recreate_database for test database working for PG (Ryan Bell)
252
+ - JRUBY-3186: disable referential integrity for PG (Ryan Bell)
253
+ - Authoritative repository now hosted at
254
+ git://github.com/nicksieger/activerecord-jdbc-adapter.git; rubyforge
255
+ svn trunk cleaned out.
256
+
257
+ == 0.8.2
258
+
259
+ - Added an optional config key called :dialect. Using :dialect allows you to
260
+ override the default SQL dialect for the driver class being used. There are
261
+ a few cases for this:
262
+ - Using using Sybase w/ the jTDS driver.
263
+ - Using rebranded drivers.
264
+ - It makes more sense to use :dialect, rather then :driver when using JNDI.
265
+ - JRUBY-2619: Typo with :test config causing problems with dev database (Igor Minar)
266
+ - 20524, JRUBY-2612: Since when did I think that there was a #true? method on Object?
267
+
268
+ == 0.8.1
269
+
270
+ - Now sporting a JDBC sqlite3 adapter! Thanks Joseph Athman.
271
+ - Added support for InterSystems Cache database (Ryan Bell)
272
+ - Fix for JRUBY-2256
273
+ - JRUBY-1638, JRUBY-2404, JRUBY-2463: schema.table handling and Oracle NUMBER fixes (Darcy Schultz & Jesse Hu)
274
+ - Add structure dump and other DDL-ish for DB2 (courtesy abedra and stuarthalloway)
275
+ - Fix missing quote_table_name function under Rails 1.2.6 and earlier
276
+ - Small tweaks to jdbc.rake to select proper config
277
+ - JRUBY-2011: Fix MSSQL string un-quoting issue (Silvio Fonseca)
278
+ - JRUBY-1977, 17427: Fix information_schema select issue with MSSQL (Matt Burke)
279
+ - 20479: Improve get_table_name for MSSQL (Aslak Hellesøy)
280
+ - 20243: numerics improvements for MSSQL (Aslak Hellesøy)
281
+ - 20172: don't quote table names for MSSQL (Thor Marius Henrichsen)
282
+ - 19729: check for primary key existence in postgres during insert (Martin Luder)
283
+ - JRUBY-2297, 18846: retrying failing SQL statements is harmful when not autocommitting (Craig McMillan)
284
+ - 10021: very preliminary sybase support. (Mark Atkinson) Not usable until collision w/ sqlserver driver is resolved.
285
+ - JRUBY-2312, JRUBY-2319, JRUBY-2322: Oracle timestamping issues (Jesse Hu & Michael König)
286
+ - JRUBY-2422: Fix MySQL referential integrity and rollback issues
287
+ - JRUBY-2382: mysql string quoting fails with ArrayIndexOutofBoundsException
288
+
289
+ == 0.8
290
+
291
+ - NOTE: This release is only compatible with JRuby 1.1RC3 or later.
292
+ - Because of recent API changes in trunk in preparation for JRuby 1.1, this release is not
293
+ backward compatible with previous JRuby releases. Hence the version bump.
294
+ - Internal: convert Java methods to be defined with annotations
295
+ - Fix problem with reserved words coming back pre-quoted from #indexes in postgres
296
+ - JRUBY-2205: Fix N^2 allocation of bytelists for mysql quoting (taw)
297
+ - Attempt a fix for Rubyforge 18059
298
+ - Upgrade derby to 10.3.2.1
299
+ - Fix db:create etc. in the case where JDBC is loaded in Rails' preinitializer.rb
300
+ - Fix db:drop to actually work
301
+ - Fix for Rubyforge #11567 (Matt Williams)
302
+
303
+ == 0.7.2
304
+
305
+ - JRUBY-1905: add_column for derby, hsqldb, and postgresql (Stephen Bannasch)
306
+ - Fix db:create for JDBC
307
+ - Support Rails 2 with the old "require 'jdbc_adapter'" approach
308
+ - JRUBY-1966: Instead of searching for just tables, search for views and tables.
309
+ - JRUBY-1583: DB2 numeric quoting (Ryan Shillington)
310
+ - JRUBY-1634: Oracle DATE type mapping (Daniel Wintschel)
311
+ - JRUBY-1543: rename_column issue with more recent MySQL drivers (Oliver Schmelzle)
312
+ - Rubyforge #15074: ConnectionAdapters::JdbcAdapter.indexes is missing name and
313
+ schema_name parameters in the method signature (Igor Minar)
314
+ - Rubyforge #13558: definition for the indexes method (T Meyarivan)
315
+ - JRUBY-2051: handle schemaname and tablename more correctly for columns
316
+ - JRUBY-2102: Postgres Adapter cannot handle datetime type (Rainer Hahnekamp)
317
+ - JRUBY-2018: Oracle behind ActiveRecord-JDBC fails with "Invalid column index" (K Venkatasubramaniyan)
318
+ - JRUBY-2012: jdbc_mysql structure dump fails for mysql views (Tyler Jennings)
319
+
320
+ == 0.7.1
321
+
322
+ - Add adapter and driver for H2 courtesy of Caleb Land
323
+ - Fix "undefined method `last' for {}:Hash" error introduced with new Rake 0.8.1 (JRUBY-1859)
324
+
325
+ == 0.7
326
+
327
+ - PLEASE NOTE: This release is not compatible with JRuby releases earlier than
328
+ 1.0.3 or 1.1b2. If you must use JRuby 1.0.2 or earlier, please install the
329
+ 0.6 release.
330
+ - Release coincides with JRuby 1.0.3 and JRuby 1.1b2 releases
331
+ - Simultaneous support for JRuby trunk and 1.0 branch
332
+ - Get rid of log_no_bench method, so we time SQL execution again.
333
+ - Implement #select_rows
334
+ - MySQL migration and quoting updates
335
+
336
+ == 0.6
337
+
338
+ - Gem is renamed to "activerecord-jdbc-adapter" to follow new conventions
339
+ introduced in Rails 2.0 for third-party adapters. Rails 2.0 compatibility is
340
+ introduced.
341
+ - Add dependency on ActiveRecord >= 1.14 (from the Rails 1.1.x release)
342
+ - New drivers (jdbc-XXX) and adapter (activerecord-jdbcXXX-adapter) gems
343
+ available separately. See the README.txt file for details.
344
+ - Plain "jdbc" driver is still available if you want to use the full
345
+ driver/url way of specifying the driver.
346
+ - More bugfixes to Oracle and SQLServer courtesy of Ola & ThoughtWorks
347
+
348
+ == 0.5
349
+
350
+ - Release coincides with JRuby 1.0.1 release
351
+ - It is no longer necessary to specify :driver and :url configuration
352
+ parameters for the mysql, postgresql, oracle, derby, hsqldb, and h2
353
+ adapters. The previous configuration is still valid and compatible, but for
354
+ new applications, this makes it possible to use the exact same database.yml
355
+ configuration as Rails applications running under native Ruby.
356
+ - JDBC drivers can now be dynamically loaded by Ruby code, without being on
357
+ the classpath prior to launching JRuby. Simply use "require
358
+ 'jdbc-driver.jar'" in JRuby code to add it to the runtime classpath.
359
+ - Updates to HSQL, MS SQLServer, Postgres, Oracle and Derby adapters
360
+
361
+ == 0.4
362
+
363
+ - Release coincides with JRuby 1.0 release
364
+ - Shoring up PostgreSQL (courtesy Dudley Flanders) and HSQL (courtesy Matthew
365
+ Williams)
366
+ - Fix timestamps on Oracle to use DATE (as everything else)
367
+ - Derby fixes: Fix for open result set issue, better structure dump, quoting,
368
+ column type changing
369
+ - Sybase type recognition fix (courtesy Dean Mao)
370
+
371
+ == 0.3.1
372
+
373
+ - Derby critical fixes shortly after 0.3
374
+
375
+ == 0.3
376
+
377
+ - Release coincides with JRuby 1.0.0RC1 release
378
+ - Improvements for Derby, Postgres, and Oracle, all of which are running
379
+ > 95% of AR tests
380
+
381
+ == 0.2.4
382
+
383
+ - Release coincides with JRuby 0.9.9 release
384
+ - JRuby 0.9.9 is required
385
+ - MySQL close to 100% working
386
+ - Derby improvements
387
+ - DECIMAL/NUMERIC/FLOAT/REAL bugs fixed with type recognition for Oracle,
388
+ Postgres, etc.
389
+ - HSQLDB has regressed this release and may not be functioning; we'll get it
390
+ fixed for the next one
391
+
392
+ == 0.2.3
393
+
394
+ - Release coincides (and compatible) with JRuby 0.9.8 release
395
+ - 8 bugs fixed: see http://rubyurl.com/0Da
396
+ - Improvements and compatibility fixes for Rails 1.2.x
397
+
398
+ == 0.2.1, 0.2.2
399
+
400
+ - Early releases, added better support for multiple databases
401
+
402
+ == 0.0.1
403
+
404
+ - Initial, very alpha release
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ Copyright (c) 2006-2008 Nick Sieger <nick@nicksieger.com>
2
+ Copyright (c) 2006-2008 Ola Bini <ola.bini@gmail.com>
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software and associated documentation files (the
6
+ "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish,
8
+ distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so, subject to
10
+ the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.txt ADDED
@@ -0,0 +1,181 @@
1
+ activerecord-jdbc-adapter is a database adapter for Rails' ActiveRecord
2
+ component that can be used with JRuby[http://www.jruby.org/]. It allows use of
3
+ virtually any JDBC-compliant database with your JRuby on Rails application.
4
+
5
+ == Databases
6
+
7
+ Activerecord-jdbc-adapter provides full or nearly full support for:
8
+ MySQL, PostgreSQL, SQLite3, Oracle, Microsoft SQL Server, DB2,
9
+ FireBird, Derby, HSQLDB, H2, and Informix.
10
+
11
+ Other databases will require testing and likely a custom configuration module.
12
+ Please join the activerecord-jdbc
13
+ mailing-lists[http://kenai.com/projects/activerecord-jdbc/lists] to help us discover
14
+ support for more databases.
15
+
16
+ == Using ActiveRecord JDBC
17
+
18
+ === Inside Rails
19
+
20
+ To use activerecord-jdbc-adapter with JRuby on Rails:
21
+
22
+ 1. Choose the adapter you wish to gem install. The following pre-packaged
23
+ adapters are available:
24
+
25
+ * base jdbc (<tt>activerecord-jdbc-adapter</tt>). Supports all available databases via JDBC, but requires you to download and manually install the database vendor's JDBC driver .jar file.
26
+ * mysql (<tt>activerecord-jdbcmysql-adapter</tt>)
27
+ * postgresql (<tt>activerecord-jdbcpostgresql-adapter</tt>)
28
+ * sqlite3 (<tt>activerecord-jdbcsqlite3-adapter</tt>)
29
+ * derby (<tt>activerecord-jdbcderby-adapter</tt>)
30
+ * hsqldb (<tt>activerecord-jdbchsqldb-adapter</tt>)
31
+ * h2 (<tt>activerecord-jdbch2-adapter</tt>)
32
+ * mssql (<tt>activerecord-jdbcmssql-adapter</tt>)
33
+
34
+ 2a. For Rails 3, if you're generating a new application, use the
35
+ following command to generate your application:
36
+
37
+ jruby -S rails new sweetapp -m http://jruby.org/rails3.rb
38
+
39
+ 2b. Otherwise, you'll need to perform some extra configuration steps
40
+ to prepare your Rails application for JDBC.
41
+
42
+ If you're using Rails 3, you'll need to modify your Gemfile to use the
43
+ activerecord-jdbc-adapter gem under JRuby. Change your Gemfile to look
44
+ like the following (using sqlite3 as an example):
45
+
46
+ if defined?(JRUBY_VERSION)
47
+ gem 'activerecord-jdbc-adapter'
48
+ gem 'jdbc-sqlite3'
49
+ else
50
+ gem 'sqlite3-ruby', :require => 'sqlite3'
51
+ end
52
+
53
+ If you're using Rails 2:
54
+
55
+ jruby script/generate jdbc
56
+
57
+ 3. Configure your database.yml in the normal Rails style.
58
+
59
+ Legacy configuration: If you use one of the convenience
60
+ 'activerecord-jdbcXXX-adapter' adapters, you can still put a 'jdbc'
61
+ prefix in front of the database adapter name as below.
62
+
63
+ development:
64
+ adapter: jdbcmysql
65
+ username: blog
66
+ password:
67
+ hostname: localhost
68
+ database: weblog_development
69
+
70
+ For other databases, you'll need to know the database driver class and
71
+ URL. Example:
72
+
73
+ development:
74
+ adapter: jdbc
75
+ username: blog
76
+ password:
77
+ driver: com.mysql.jdbc.Driver
78
+ url: jdbc:mysql://localhost:3306/weblog_development
79
+
80
+ For JNDI data sources, you may simply specify the JNDI location as follows
81
+ (the adapter will be automatically detected):
82
+
83
+ production:
84
+ adapter: jdbc
85
+ jndi: jdbc/mysqldb
86
+
87
+ === Standalone, with ActiveRecord
88
+
89
+ 1. Install the gem with JRuby:
90
+
91
+ jruby -S gem install activerecord-jdbc-adapter
92
+
93
+ If you wish to use the adapter for a specific database, you can
94
+ install it directly and a driver gem will be installed as well:
95
+
96
+ jruby -S gem install activerecord-jdbcderby-adapter
97
+
98
+ 2. After this you can establish a JDBC connection like this:
99
+
100
+ ActiveRecord::Base.establish_connection(
101
+ :adapter => 'jdbcderby',
102
+ :database => "db/my-database"
103
+ )
104
+
105
+ or like this (but requires that you manually put the driver jar on the classpath):
106
+
107
+ ActiveRecord::Base.establish_connection(
108
+ :adapter => 'jdbc',
109
+ :driver => 'org.apache.derby.jdbc.EmbeddedDriver',
110
+ :url => 'jdbc:derby:test_ar;create=true'
111
+ )
112
+
113
+ == Extending AR-JDBC
114
+
115
+ You can create your own extension to AR-JDBC for a JDBC-based database
116
+ that core AR-JDBC does not support. We've created an example project
117
+ for the Intersystems Cache database that you can examine as a
118
+ template. See the project for more information at the following URL:
119
+
120
+ http://github.com/nicksieger/activerecord-cachedb-adapter
121
+
122
+ == Getting the source
123
+
124
+ The source for activerecord-jdbc-adapter is available using git.
125
+
126
+ git clone git://github.com/nicksieger/activerecord-jdbc-adapter.git
127
+
128
+ == Feedback
129
+
130
+ Please file bug reports at
131
+ http://kenai.com/jira/browse/ACTIVERECORD_JDBC. If you're not sure if
132
+ something's a bug, feel free to pre-report it on the mailing lists.
133
+
134
+ == Project Info
135
+
136
+ * Mailing Lists: http://kenai.com/projects/activerecord-jdbc/lists
137
+ * Issues: http://kenai.com/jira/browse/ACTIVERECORD_JDBC
138
+ * Source:
139
+ git://github.com/nicksieger/activerecord-jdbc-adapter.git
140
+ git://kenai.com/activerecord-jdbc~main
141
+
142
+ == Running AR-JDBC's Tests
143
+
144
+ Drivers for 6 open-source databases are included. Provided you have
145
+ MySQL installed, you can simply type <tt>jruby -S rake</tt> to run the
146
+ tests. A database named <tt>weblog_development</tt> is needed
147
+ beforehand with a connection user of "blog" and an empty password. You
148
+ alse need to grant "blog" create privileges on
149
+ 'test_rake_db_create.*'.
150
+
151
+ If you also have PostgreSQL available, those tests will be run if the
152
+ `psql' executable can be found. Also ensure you have a database named
153
+ <tt>weblog_development</tt> and a user named "blog" and an empty
154
+ password.
155
+
156
+ If you want rails logging enabled during these test runs you can edit
157
+ test/jdbc_common.rb and add the following line:
158
+
159
+ require 'db/logger'
160
+
161
+ == Running AR Tests
162
+
163
+ To run the current AR-JDBC sources with ActiveRecord, just use the
164
+ included "rails:test" task. Be sure to specify a driver and a path to
165
+ the ActiveRecord sources.
166
+
167
+ jruby -S rake rails:test DRIVER=mysql RAILS=/path/activerecord_source_dir
168
+
169
+ == Authors
170
+
171
+ This project was written by Nick Sieger <nick@nicksieger.com> and Ola Bini
172
+ <olabini@gmail.com> with lots of help from the JRuby community.
173
+
174
+ == License
175
+
176
+ activerecord-jdbc-adapter is released under a BSD license. See the LICENSE file
177
+ included with the distribution for details.
178
+
179
+ Open-source driver gems for activerecord-jdbc-adapter are licensed under the
180
+ same license the database's drivers are licensed. See each driver gem's
181
+ LICENSE.txt file for details.