activerecord-jdbc-adapter 0.9.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. data/History.txt +163 -0
  2. data/Manifest.txt +130 -65
  3. data/README.txt +64 -72
  4. data/lib/active_record/connection_adapters/derby_adapter.rb +1 -13
  5. data/lib/active_record/connection_adapters/h2_adapter.rb +1 -13
  6. data/lib/active_record/connection_adapters/hsqldb_adapter.rb +1 -13
  7. data/lib/active_record/connection_adapters/informix_adapter.rb +1 -1
  8. data/lib/active_record/connection_adapters/jdbc_adapter.rb +1 -633
  9. data/lib/active_record/connection_adapters/jndi_adapter.rb +1 -1
  10. data/lib/active_record/connection_adapters/mssql_adapter.rb +1 -0
  11. data/lib/active_record/connection_adapters/mysql2_adapter.rb +1 -0
  12. data/lib/active_record/connection_adapters/mysql_adapter.rb +1 -13
  13. data/lib/active_record/connection_adapters/oracle_adapter.rb +1 -1
  14. data/lib/active_record/connection_adapters/postgresql_adapter.rb +1 -13
  15. data/lib/active_record/connection_adapters/sqlite3_adapter.rb +1 -13
  16. data/lib/activerecord-jdbc-adapter.rb +6 -0
  17. data/lib/arel/engines/sql/compilers/db2_compiler.rb +9 -0
  18. data/lib/arel/engines/sql/compilers/derby_compiler.rb +6 -0
  19. data/lib/arel/engines/sql/compilers/h2_compiler.rb +6 -0
  20. data/lib/arel/engines/sql/compilers/hsqldb_compiler.rb +15 -0
  21. data/lib/arel/engines/sql/compilers/jdbc_compiler.rb +6 -0
  22. data/lib/arel/engines/sql/compilers/mssql_compiler.rb +46 -0
  23. data/lib/arel/visitors/db2.rb +15 -0
  24. data/lib/arel/visitors/derby.rb +19 -0
  25. data/lib/arel/visitors/hsqldb.rb +24 -0
  26. data/lib/arel/visitors/mssql.rb +44 -0
  27. data/lib/arjdbc.rb +29 -0
  28. data/lib/arjdbc/db2.rb +2 -0
  29. data/lib/arjdbc/db2/adapter.rb +413 -0
  30. data/lib/arjdbc/derby.rb +7 -0
  31. data/lib/{jdbc_adapter/jdbc_derby.rb → arjdbc/derby/adapter.rb} +58 -132
  32. data/lib/arjdbc/derby/connection_methods.rb +18 -0
  33. data/lib/arjdbc/discover.rb +92 -0
  34. data/lib/arjdbc/firebird.rb +2 -0
  35. data/lib/{jdbc_adapter/jdbc_firebird.rb → arjdbc/firebird/adapter.rb} +36 -14
  36. data/lib/arjdbc/h2.rb +4 -0
  37. data/lib/arjdbc/h2/adapter.rb +36 -0
  38. data/lib/arjdbc/h2/connection_methods.rb +12 -0
  39. data/lib/arjdbc/hsqldb.rb +4 -0
  40. data/lib/{jdbc_adapter/jdbc_hsqldb.rb → arjdbc/hsqldb/adapter.rb} +34 -62
  41. data/lib/arjdbc/hsqldb/connection_methods.rb +14 -0
  42. data/lib/arjdbc/informix.rb +3 -0
  43. data/lib/{jdbc_adapter/jdbc_informix.rb → arjdbc/informix/adapter.rb} +10 -19
  44. data/lib/arjdbc/informix/connection_methods.rb +10 -0
  45. data/lib/arjdbc/jdbc.rb +2 -0
  46. data/lib/arjdbc/jdbc/adapter.rb +285 -0
  47. data/lib/arjdbc/jdbc/adapter_java.jar +0 -0
  48. data/lib/arjdbc/jdbc/callbacks.rb +44 -0
  49. data/lib/arjdbc/jdbc/column.rb +38 -0
  50. data/lib/arjdbc/jdbc/compatibility.rb +51 -0
  51. data/lib/arjdbc/jdbc/connection.rb +128 -0
  52. data/lib/arjdbc/jdbc/connection_methods.rb +16 -0
  53. data/lib/arjdbc/jdbc/core_ext.rb +24 -0
  54. data/lib/arjdbc/jdbc/discover.rb +18 -0
  55. data/lib/arjdbc/jdbc/driver.rb +44 -0
  56. data/lib/arjdbc/jdbc/extension.rb +47 -0
  57. data/lib/arjdbc/jdbc/java.rb +14 -0
  58. data/lib/{jdbc_adapter → arjdbc/jdbc}/jdbc.rake +36 -26
  59. data/lib/{jdbc_adapter → arjdbc/jdbc}/missing_functionality_helper.rb +5 -5
  60. data/lib/arjdbc/jdbc/quoted_primary_key.rb +28 -0
  61. data/lib/arjdbc/jdbc/railtie.rb +9 -0
  62. data/lib/arjdbc/jdbc/rake_tasks.rb +10 -0
  63. data/lib/arjdbc/jdbc/require_driver.rb +16 -0
  64. data/lib/arjdbc/jdbc/type_converter.rb +126 -0
  65. data/lib/arjdbc/mimer.rb +2 -0
  66. data/lib/{jdbc_adapter/jdbc_mimer.rb → arjdbc/mimer/adapter.rb} +17 -16
  67. data/lib/arjdbc/mssql.rb +4 -0
  68. data/lib/arjdbc/mssql/adapter.rb +472 -0
  69. data/lib/arjdbc/mssql/connection_methods.rb +30 -0
  70. data/lib/arjdbc/mssql/limit_helpers.rb +92 -0
  71. data/lib/{jdbc_adapter → arjdbc/mssql}/tsql_helper.rb +2 -1
  72. data/lib/arjdbc/mysql.rb +4 -0
  73. data/lib/arjdbc/mysql/adapter.rb +416 -0
  74. data/lib/arjdbc/mysql/connection_methods.rb +27 -0
  75. data/lib/arjdbc/oracle.rb +3 -0
  76. data/lib/{jdbc_adapter/jdbc_oracle.rb → arjdbc/oracle/adapter.rb} +68 -33
  77. data/lib/arjdbc/oracle/connection_methods.rb +11 -0
  78. data/lib/arjdbc/postgresql.rb +4 -0
  79. data/lib/{jdbc_adapter/jdbc_postgre.rb → arjdbc/postgresql/adapter.rb} +147 -72
  80. data/lib/arjdbc/postgresql/connection_methods.rb +21 -0
  81. data/lib/arjdbc/sqlite3.rb +4 -0
  82. data/lib/arjdbc/sqlite3/adapter.rb +381 -0
  83. data/lib/arjdbc/sqlite3/connection_methods.rb +34 -0
  84. data/lib/arjdbc/sybase.rb +2 -0
  85. data/lib/arjdbc/sybase/adapter.rb +46 -0
  86. data/lib/arjdbc/version.rb +8 -0
  87. data/lib/generators/jdbc/jdbc_generator.rb +9 -0
  88. data/lib/jdbc_adapter.rb +2 -27
  89. data/lib/jdbc_adapter/rake_tasks.rb +3 -10
  90. data/lib/jdbc_adapter/version.rb +3 -5
  91. data/lib/pg.rb +23 -1
  92. data/rails_generators/jdbc_generator.rb +2 -2
  93. data/rails_generators/templates/{jdbc.rb → config/initializers/jdbc.rb} +1 -1
  94. data/rails_generators/templates/{jdbc.rake → lib/tasks/jdbc.rake} +2 -2
  95. data/rakelib/compile.rake +5 -3
  96. data/rakelib/db.rake +19 -0
  97. data/rakelib/package.rake +12 -6
  98. data/rakelib/test.rake +24 -14
  99. data/src/java/{jdbc_adapter/JdbcDerbySpec.java → arjdbc/derby/DerbyModule.java} +63 -34
  100. data/src/java/arjdbc/h2/H2RubyJdbcConnection.java +70 -0
  101. data/src/java/{jdbc_adapter/MssqlRubyJdbcConnection.java → arjdbc/informix/InformixRubyJdbcConnection.java} +15 -12
  102. data/src/java/{jdbc_adapter/JdbcAdapterInternalService.java → arjdbc/jdbc/AdapterJavaService.java} +21 -8
  103. data/src/java/{jdbc_adapter → arjdbc/jdbc}/JdbcConnectionFactory.java +6 -6
  104. data/src/java/{jdbc_adapter → arjdbc/jdbc}/RubyJdbcConnection.java +210 -67
  105. data/src/java/arjdbc/jdbc/SQLBlock.java +48 -0
  106. data/src/java/arjdbc/mssql/MssqlRubyJdbcConnection.java +127 -0
  107. data/src/java/{jdbc_adapter/JdbcMySQLSpec.java → arjdbc/mysql/MySQLModule.java} +12 -12
  108. data/src/java/arjdbc/mysql/MySQLRubyJdbcConnection.java +87 -0
  109. data/src/java/arjdbc/oracle/OracleRubyJdbcConnection.java +85 -0
  110. data/src/java/{jdbc_adapter/PostgresRubyJdbcConnection.java → arjdbc/postgresql/PostgresqlRubyJdbcConnection.java} +11 -9
  111. data/src/java/arjdbc/sqlite3/Sqlite3RubyJdbcConnection.java +64 -0
  112. data/test/abstract_db_create.rb +98 -19
  113. data/test/activerecord/connection_adapters/type_conversion_test.rb +1 -1
  114. data/test/db/db2.rb +4 -2
  115. data/test/db/derby.rb +12 -14
  116. data/test/db/hsqldb.rb +3 -2
  117. data/test/db/jndi_config.rb +22 -12
  118. data/test/db/mssql.rb +5 -5
  119. data/test/db/sqlite3.rb +2 -6
  120. data/test/db2_simple_test.rb +56 -0
  121. data/test/derby_migration_test.rb +50 -3
  122. data/test/derby_simple_test.rb +87 -0
  123. data/test/generic_jdbc_connection_test.rb +21 -1
  124. data/test/h2_simple_test.rb +35 -0
  125. data/test/jdbc_common.rb +4 -5
  126. data/test/jndi_callbacks_test.rb +3 -1
  127. data/test/jndi_test.rb +1 -11
  128. data/test/models/entry.rb +20 -0
  129. data/test/models/mixed_case.rb +7 -2
  130. data/test/models/string_id.rb +18 -0
  131. data/test/mssql_db_create_test.rb +26 -0
  132. data/test/mssql_identity_insert_test.rb +19 -0
  133. data/test/mssql_legacy_types_test.rb +58 -0
  134. data/test/mssql_limit_offset_test.rb +136 -0
  135. data/test/mssql_multibyte_test.rb +18 -0
  136. data/test/mssql_simple_test.rb +49 -0
  137. data/test/mysql_db_create_test.rb +8 -6
  138. data/test/mysql_info_test.rb +123 -0
  139. data/test/mysql_simple_test.rb +19 -1
  140. data/test/oracle_simple_test.rb +9 -20
  141. data/test/oracle_specific_test.rb +83 -0
  142. data/test/pick_rails_version.rb +3 -0
  143. data/test/postgres_db_create_test.rb +11 -0
  144. data/test/postgres_drop_db_test.rb +16 -0
  145. data/test/postgres_mixed_case_test.rb +11 -1
  146. data/test/postgres_nonseq_pkey_test.rb +0 -2
  147. data/test/postgres_schema_search_path_test.rb +44 -0
  148. data/test/postgres_simple_test.rb +53 -0
  149. data/test/postgres_table_alias_length_test.rb +15 -0
  150. data/test/simple.rb +103 -9
  151. data/test/sqlite3_simple_test.rb +1 -0
  152. data/test/sybase_jtds_simple_test.rb +22 -0
  153. metadata +239 -137
  154. data/lib/active_record/connection_adapters/cachedb_adapter.rb +0 -1
  155. data/lib/active_record/connection_adapters/jdbc_adapter_spec.rb +0 -26
  156. data/lib/jdbc_adapter/jdbc_adapter_internal.jar +0 -0
  157. data/lib/jdbc_adapter/jdbc_cachedb.rb +0 -33
  158. data/lib/jdbc_adapter/jdbc_db2.rb +0 -191
  159. data/lib/jdbc_adapter/jdbc_mssql.rb +0 -333
  160. data/lib/jdbc_adapter/jdbc_mysql.rb +0 -236
  161. data/lib/jdbc_adapter/jdbc_sqlite3.rb +0 -379
  162. data/lib/jdbc_adapter/jdbc_sybase.rb +0 -50
  163. data/src/java/jdbc_adapter/SQLBlock.java +0 -27
  164. data/src/java/jdbc_adapter/Sqlite3RubyJdbcConnection.java +0 -41
  165. data/test/cachedb_simple_test.rb +0 -6
  166. data/test/db/cachedb.rb +0 -9
  167. data/test/jdbc_adapter/jdbc_db2_test.rb +0 -26
  168. data/test/jdbc_adapter/jdbc_sybase_test.rb +0 -33
  169. data/test/minirunit.rb +0 -109
  170. data/test/minirunit/testConnect.rb +0 -14
  171. data/test/minirunit/testH2.rb +0 -73
  172. data/test/minirunit/testHsqldb.rb +0 -73
  173. data/test/minirunit/testLoadActiveRecord.rb +0 -3
  174. data/test/minirunit/testMysql.rb +0 -83
  175. data/test/minirunit/testRawSelect.rb +0 -24
@@ -1,3 +1,166 @@
1
+ == 1.1.0 (12/09/10)
2
+
3
+ - Don't narrow platform to '-java' only: revert back to 0.9.2 where
4
+ ar-jdbc can be installed under any Ruby (for easier Bundler/Warbler
5
+ usage and less confusion on rubygems.org).
6
+ - Upgrade MySQL execute code to use RETURN_GENERATED_KEYS.
7
+ - Upgrade to MySQL driver version 5.1.13
8
+ - Add multi-statement support, idea from oruen. For databases that
9
+ support it, you can now do:
10
+ results = Model.connection.execute("select 1; select 2")
11
+ and receive back an array of multiple result set arrays. For use with
12
+ MySQL, you need to add
13
+ options:
14
+ allowMultiQueries: true
15
+ in database.yml.
16
+ - ACTIVERECORD_JDBC-144: Fix limits appearing in schema dump for some
17
+ datatypes (Uwe Kubosch)
18
+ - Fixes for DB2 limit/offset
19
+ - Fix rake db:create for 'jdbc' adapter (Joeri Samson)
20
+ - add create/drop database methods to h2 adapter (sahglie)
21
+ - Use connection getDatabaseProductName instead of getClass.getName
22
+ when detecting JNDI dialects (Denis Odorcic)
23
+ - ACTIVERECORD_JDBC-146: Fix create_table to not append encoding (Marc Slemko)
24
+ - All green on SQLite3 Rails master ActiveRecord tests
25
+ - ACTIVERECORD_JDBC-140: Sync postgres add/change column code from Rails master
26
+ - ACTIVERECORD_JDBC-139: TEXT/DATE on PostgreSQL should not have limits
27
+
28
+ == 1.0.3 (11/29/10)
29
+
30
+ - ACTIVERECORD_JDBC-143: Implement table_exists? fixing association
31
+ table names with schema prefixes
32
+ - Cleanup of column code for hsqldb (Denis Odorcic)
33
+ - Rails 3.0.3 support - add Arel 2 visitors for all adapters
34
+ - Fix MySQL date types to not have limits (Chris Lowder)
35
+ - ACTIVERECORD_JDBC-141: Better schema support in H2
36
+
37
+ == 1.0.2
38
+
39
+ - ACTIVERECORD_JDBC-134: Fix conflicting adapter/column superclasses
40
+ - ACTIVERECORD_JDBC-135: Fix regression on PG with boolean and :limit
41
+ - Slew of Derby fixes courtesy of Denis Odorcic
42
+
43
+ == 1.0.1
44
+
45
+ - Fix db:test:purge issue affecting all adapters in 1.0.0 due to
46
+ incorrect fix to JRUBY-5081 in 8b4b9c5
47
+
48
+ == 1.0.0
49
+
50
+ - Thanks to David Kellum, Dmitry Denisov, Dwayne Litzenberger, Gregor
51
+ Schmidt, James Walker, John Duff, Joshua Suggs, Nicholas J Kreucher,
52
+ Peter Donald, Geoff Longman, Uwe Kubosch, Youhei Kondou, Michael
53
+ Pitman, Alex B, and Ryan Bell for their contributions to this
54
+ release.
55
+ - BIG set of DB2 updates (Thanks Nick Kreucher)
56
+ - Deprecate jdbc_adapter/rake_tasks
57
+ - (1.0.0.beta1)
58
+ - Make database-specific extensions only load when necessary
59
+ - Allow for discovery of database extensions outside of ar-jdbc
60
+ proper. This should allow for custom database development to be
61
+ developed and released without relying on AR-JDBC core.
62
+ - Get AR's own tests running as close to 100% as possible. MySQL is
63
+ currently 100%, SQLite3 is close.
64
+ - JRUBY-4876: Bump up Derby's max index name length (Uwe Kubosch)
65
+ - (1.0.0.beta2)
66
+ - 98 commits since beta1
67
+ - MSSQL updates from dlitz and realityforge
68
+ - ACTIVERECORD_JDBC-131: Fix string slug issue for DB2 (Youhei Kondou)
69
+ - JRUBY-1642: Don't use H2 INFORMATION_SCHEMA in table or column
70
+ searches
71
+ - JRUBY-4972: Attempt to deal with type(0)/:limit => 0 by not setting
72
+ it808e213
73
+ - JRUBY-5040: Fix issue with limits on timestamps in MySQL
74
+ - JRUBY-3555: Allow setting Derby schema with 'schema:' option
75
+ - ACTIVERECORD_JDBC-98: Make sure we actuall raise an error when
76
+ inappropriately configured
77
+ - ACTIVERECORD_JDBC-112: Add schema dumper tests for already-fixed
78
+ MySQL type limits
79
+ - ACTIVERECORD_JDBC-113: Fix PG float precision issue
80
+ - ACTIVERECORD_JDBC-103: Fix decimal options for PG add/change column
81
+ (Michael Pitman)
82
+ - ACTIVERECORD_JDBC-127: Fix quoting of Date vs. Time(stamp) for
83
+ Oracle (Lenny Marks)
84
+ - Oracle: Sort out the NUMBER vs NUMBER(x) vs NUMBER(x,y) situation.
85
+ - JRUBY-3051: Think we finally got the PG mixed-case patches applied.
86
+ - JRUBY-5081: Consolidate code for dropping DB via postgres
87
+ - ACTIVERECORD_JDBC-101: Add override of LONGVARCHAR => CLOB for
88
+ informix
89
+ - ACTIVERECORD_JDBC-107: Fix MySQL update_all issue on AR 2.3
90
+ - ACTIVERECORD_JDBC-124: Filter out special _row_num column
91
+ - ACTIVERECORD_JDBC-126: Fix sql 2000 limit/offset per Michael Pitman
92
+ - ACTIVERECORD_JDBC-125: Add tweak to limit/offset code for HABTM
93
+ queries (alex b)
94
+ - ACTIVERECORD_JDBC-129: Don't have limits for text, binary or bit
95
+ fields
96
+ - (1.0.0 final)
97
+ - Fix a few more SQLite3 AR tests
98
+ - SQLite3: handle ":memory:" database
99
+ - Release new SQLite3 driver 3.6.14.2 and new Derby driver 10.6.2.1
100
+
101
+ == 0.9.7
102
+
103
+ - JRUBY-4781: Fix multiple database connection collision issue w/
104
+ Oracle
105
+ - ACTIVERECORD_JDBC-115: Support SAVEPOINTS for MySQL and PG so that
106
+ nested transactions can be faked
107
+ - ACTIVERECORD_JDBC-116: Handle schema.table better for MySQL (thanks
108
+ Dilshod Mukhtarov)
109
+ - Fix 'Wrong # of arguments (2 for 1)' issue with #create_database for
110
+ MySQL and AR 3.0
111
+ - SQLServer 2000 support (thanks Jay McGaffigan)
112
+
113
+ == 0.9.6
114
+
115
+ - The Oracle release!
116
+ - Oracle should be working much better with this release. Also updated
117
+ to work with Rails 3.
118
+ - Get all unit tests running cleanly on Oracle, fixing previous
119
+ datetime/timezone issues.
120
+ - ACTIVERECORD_JDBC-83: Add :sequence_start_value option to
121
+ create_table, following oracle_enhanced adapter
122
+ - ACTIVERECORD_JDBC-33: Don't double-quote table names in oracle
123
+ - ACTIVERECORD_JDBC-17: Fix Oracle primary keys so that /^NUMBER$/ => :integer
124
+ - Fix remaining blockers ACTIVERECORD_JDBC-82, JRUBY-3675,
125
+ ACTIVERECORD_JDBC-22, ACTIVERECORD_JDBC-27, JRUBY-4759
126
+
127
+ == 0.9.5
128
+
129
+ - The MSSQL release, courtesy of Mike Williams and Lonely
130
+ Planet.
131
+ - JRuby + AR-JDBC is now seen as the hassle-free way of using Rails
132
+ with SQLServer!
133
+ - Many fixes for MSSQL, including ACTIVERECORD_JDBC-18,
134
+ ACTIVERECORD_JDBC-41, ACTIVERECORD_JDBC-56, ACTIVERECORD_JDBC-94,
135
+ ACTIVERECORD_JDBC-99, JRUBY-3805, JRUBY-3793, JRUBY-4221
136
+ - All tests pass on Rails 3.0.0.beta3!
137
+
138
+ == 0.9.4
139
+
140
+ - ACTIVERECORD_JDBC-96: DB2 JdbcSpec cannot dump schema correctly
141
+ (Youhei Kondou)
142
+ - ACTIVERECORD_JDBC-97: Dont use Rails 3 deprecated constants (David
143
+ Calavera)
144
+ - Updates for rake db:schema:dump compatibility with Rails 2.3+ and
145
+ MySQL (Joakim Kolsj�)
146
+ - Rails 3.0.0.beta2 compatibility
147
+ - Return of Derby, H2, Hsqldb support (requires AR >= 3.0.0.beta2)
148
+
149
+ == 0.9.3
150
+
151
+ - Rails 3 compatibility
152
+ - PLEASE NOTE: ActiveRecord in Rails 3 has changed in a way that
153
+ doesn't allow non-standard DBs (such as the Derby and H2 embedded
154
+ DBs) to work. We're investigating the effort required to support
155
+ these databases and hope to have something for a future release.
156
+ - ACTIVERECORD_JDBC-91: Fix schema search path for PostgreSQL (Alex
157
+ Kuebo)
158
+ - ACTIVERECORD_JDBC-87: DB2 ID insert fix (Youhei Kondou)
159
+ - ACTIVERECORD_JDBC-90: MSSQL fix for DATEs (jlangenauer)
160
+ - ACTIVERECORD_JDBC-93: Fix string IDs for sqlite3, hsql/h2 (moser)
161
+ - ACTIVERECORD_JDBC-86: Fix Derby queries starting with VALUES (Dwayne Litzenberger)
162
+ - ACTIVERECORD_JDBC-95: Fix INSERT ... RETURNING for PostgreSQL
163
+
1
164
  == 0.9.2
2
165
 
3
166
  - The main, highly awaited fix for this release is a solution to the
@@ -3,56 +3,94 @@ Manifest.txt
3
3
  README.txt
4
4
  Rakefile
5
5
  LICENSE.txt
6
- lib/active_record/connection_adapters/cachedb_adapter.rb
6
+ lib/activerecord-jdbc-adapter.rb
7
+ lib/arjdbc.rb
8
+ lib/jdbc_adapter.rb
9
+ lib/pg.rb
7
10
  lib/active_record/connection_adapters/derby_adapter.rb
8
11
  lib/active_record/connection_adapters/h2_adapter.rb
9
12
  lib/active_record/connection_adapters/hsqldb_adapter.rb
10
13
  lib/active_record/connection_adapters/informix_adapter.rb
11
14
  lib/active_record/connection_adapters/jdbc_adapter.rb
12
- lib/active_record/connection_adapters/jdbc_adapter_spec.rb
13
15
  lib/active_record/connection_adapters/jndi_adapter.rb
16
+ lib/active_record/connection_adapters/mssql_adapter.rb
17
+ lib/active_record/connection_adapters/mysql2_adapter.rb
14
18
  lib/active_record/connection_adapters/mysql_adapter.rb
15
19
  lib/active_record/connection_adapters/oracle_adapter.rb
16
20
  lib/active_record/connection_adapters/postgresql_adapter.rb
17
21
  lib/active_record/connection_adapters/sqlite3_adapter.rb
18
- lib/jdbc_adapter/jdbc_cachedb.rb
19
- lib/jdbc_adapter/jdbc_db2.rb
20
- lib/jdbc_adapter/jdbc_derby.rb
21
- lib/jdbc_adapter/jdbc_firebird.rb
22
- lib/jdbc_adapter/jdbc_hsqldb.rb
23
- lib/jdbc_adapter/jdbc_informix.rb
24
- lib/jdbc_adapter/jdbc_mimer.rb
25
- lib/jdbc_adapter/jdbc_mssql.rb
26
- lib/jdbc_adapter/jdbc_mysql.rb
27
- lib/jdbc_adapter/jdbc_oracle.rb
28
- lib/jdbc_adapter/jdbc_postgre.rb
29
- lib/jdbc_adapter/jdbc_sqlite3.rb
30
- lib/jdbc_adapter/jdbc_sybase.rb
31
- lib/jdbc_adapter/missing_functionality_helper.rb
22
+ lib/arel/engines/sql/compilers/db2_compiler.rb
23
+ lib/arel/engines/sql/compilers/derby_compiler.rb
24
+ lib/arel/engines/sql/compilers/h2_compiler.rb
25
+ lib/arel/engines/sql/compilers/hsqldb_compiler.rb
26
+ lib/arel/engines/sql/compilers/jdbc_compiler.rb
27
+ lib/arel/engines/sql/compilers/mssql_compiler.rb
28
+ lib/arel/visitors/db2.rb
29
+ lib/arel/visitors/derby.rb
30
+ lib/arel/visitors/hsqldb.rb
31
+ lib/arel/visitors/mssql.rb
32
+ lib/arjdbc/db2.rb
33
+ lib/arjdbc/derby.rb
34
+ lib/arjdbc/discover.rb
35
+ lib/arjdbc/firebird.rb
36
+ lib/arjdbc/h2.rb
37
+ lib/arjdbc/hsqldb.rb
38
+ lib/arjdbc/informix.rb
39
+ lib/arjdbc/jdbc.rb
40
+ lib/arjdbc/mimer.rb
41
+ lib/arjdbc/mssql.rb
42
+ lib/arjdbc/mysql.rb
43
+ lib/arjdbc/oracle.rb
44
+ lib/arjdbc/postgresql.rb
45
+ lib/arjdbc/sqlite3.rb
46
+ lib/arjdbc/sybase.rb
47
+ lib/arjdbc/version.rb
48
+ lib/arjdbc/db2/adapter.rb
49
+ lib/arjdbc/derby/adapter.rb
50
+ lib/arjdbc/derby/connection_methods.rb
51
+ lib/arjdbc/firebird/adapter.rb
52
+ lib/arjdbc/h2/adapter.rb
53
+ lib/arjdbc/h2/connection_methods.rb
54
+ lib/arjdbc/hsqldb/adapter.rb
55
+ lib/arjdbc/hsqldb/connection_methods.rb
56
+ lib/arjdbc/informix/adapter.rb
57
+ lib/arjdbc/informix/connection_methods.rb
58
+ lib/arjdbc/jdbc/adapter.rb
59
+ lib/arjdbc/jdbc/callbacks.rb
60
+ lib/arjdbc/jdbc/column.rb
61
+ lib/arjdbc/jdbc/compatibility.rb
62
+ lib/arjdbc/jdbc/connection.rb
63
+ lib/arjdbc/jdbc/connection_methods.rb
64
+ lib/arjdbc/jdbc/core_ext.rb
65
+ lib/arjdbc/jdbc/discover.rb
66
+ lib/arjdbc/jdbc/driver.rb
67
+ lib/arjdbc/jdbc/extension.rb
68
+ lib/arjdbc/jdbc/java.rb
69
+ lib/arjdbc/jdbc/missing_functionality_helper.rb
70
+ lib/arjdbc/jdbc/quoted_primary_key.rb
71
+ lib/arjdbc/jdbc/railtie.rb
72
+ lib/arjdbc/jdbc/rake_tasks.rb
73
+ lib/arjdbc/jdbc/require_driver.rb
74
+ lib/arjdbc/jdbc/type_converter.rb
75
+ lib/arjdbc/mimer/adapter.rb
76
+ lib/arjdbc/mssql/adapter.rb
77
+ lib/arjdbc/mssql/connection_methods.rb
78
+ lib/arjdbc/mssql/limit_helpers.rb
79
+ lib/arjdbc/mssql/tsql_helper.rb
80
+ lib/arjdbc/mysql/adapter.rb
81
+ lib/arjdbc/mysql/connection_methods.rb
82
+ lib/arjdbc/oracle/adapter.rb
83
+ lib/arjdbc/oracle/connection_methods.rb
84
+ lib/arjdbc/postgresql/adapter.rb
85
+ lib/arjdbc/postgresql/connection_methods.rb
86
+ lib/arjdbc/sqlite3/adapter.rb
87
+ lib/arjdbc/sqlite3/connection_methods.rb
88
+ lib/arjdbc/sybase/adapter.rb
89
+ lib/generators/jdbc/jdbc_generator.rb
32
90
  lib/jdbc_adapter/rake_tasks.rb
33
- lib/jdbc_adapter/tsql_helper.rb
34
91
  lib/jdbc_adapter/version.rb
35
- lib/jdbc_adapter.rb
36
- lib/pg.rb
37
- lib/jdbc_adapter/jdbc_adapter_internal.jar
92
+ lib/arjdbc/jdbc/adapter_java.jar
38
93
  test/abstract_db_create.rb
39
- test/activerecord/connection_adapters/type_conversion_test.rb
40
- test/activerecord/connections/native_jdbc_mysql/connection.rb
41
- test/cachedb_simple_test.rb
42
- test/db/cachedb.rb
43
- test/db/db2.rb
44
- test/db/derby.rb
45
- test/db/h2.rb
46
- test/db/hsqldb.rb
47
- test/db/informix.rb
48
- test/db/jdbc.rb
49
- test/db/jndi_config.rb
50
- test/db/logger.rb
51
- test/db/mssql.rb
52
- test/db/mysql.rb
53
- test/db/oracle.rb
54
- test/db/postgres.rb
55
- test/db/sqlite3.rb
56
94
  test/db2_simple_test.rb
57
95
  test/derby_migration_test.rb
58
96
  test/derby_multibyte_test.rb
@@ -63,55 +101,82 @@ test/has_many_through.rb
63
101
  test/helper.rb
64
102
  test/hsqldb_simple_test.rb
65
103
  test/informix_simple_test.rb
66
- test/jdbc_adapter/jdbc_db2_test.rb
67
- test/jdbc_adapter/jdbc_sybase_test.rb
68
104
  test/jdbc_common.rb
69
105
  test/jndi_callbacks_test.rb
70
106
  test/jndi_test.rb
71
107
  test/manualTestDatabase.rb
72
- test/minirunit/testConnect.rb
73
- test/minirunit/testH2.rb
74
- test/minirunit/testHsqldb.rb
75
- test/minirunit/testLoadActiveRecord.rb
76
- test/minirunit/testMysql.rb
77
- test/minirunit/testRawSelect.rb
78
- test/minirunit.rb
79
- test/models/add_not_null_column_to_table.rb
80
- test/models/auto_id.rb
81
- test/models/data_types.rb
82
- test/models/entry.rb
83
- test/models/mixed_case.rb
84
- test/models/reserved_word.rb
85
- test/models/validates_uniqueness_of_string.rb
108
+ test/mssql_db_create_test.rb
109
+ test/mssql_identity_insert_test.rb
110
+ test/mssql_legacy_types_test.rb
111
+ test/mssql_limit_offset_test.rb
112
+ test/mssql_multibyte_test.rb
86
113
  test/mssql_simple_test.rb
87
114
  test/mysql_db_create_test.rb
115
+ test/mysql_info_test.rb
88
116
  test/mysql_multibyte_test.rb
89
117
  test/mysql_nonstandard_primary_key_test.rb
90
118
  test/mysql_simple_test.rb
91
119
  test/oracle_simple_test.rb
120
+ test/oracle_specific_test.rb
121
+ test/pick_rails_version.rb
92
122
  test/postgres_db_create_test.rb
123
+ test/postgres_drop_db_test.rb
93
124
  test/postgres_mixed_case_test.rb
94
125
  test/postgres_nonseq_pkey_test.rb
95
126
  test/postgres_reserved_test.rb
127
+ test/postgres_schema_search_path_test.rb
96
128
  test/postgres_simple_test.rb
129
+ test/postgres_table_alias_length_test.rb
97
130
  test/simple.rb
98
131
  test/sqlite3_simple_test.rb
99
132
  test/sybase_jtds_simple_test.rb
100
- lib/jdbc_adapter/jdbc.rake
101
- src/java/jdbc_adapter/JdbcAdapterInternalService.java
102
- src/java/jdbc_adapter/JdbcConnectionFactory.java
103
- src/java/jdbc_adapter/JdbcDerbySpec.java
104
- src/java/jdbc_adapter/JdbcMySQLSpec.java
105
- src/java/jdbc_adapter/MssqlRubyJdbcConnection.java
106
- src/java/jdbc_adapter/PostgresRubyJdbcConnection.java
107
- src/java/jdbc_adapter/RubyJdbcConnection.java
108
- src/java/jdbc_adapter/SQLBlock.java
109
- src/java/jdbc_adapter/Sqlite3RubyJdbcConnection.java
133
+ test/activerecord/connection_adapters/type_conversion_test.rb
134
+ test/activerecord/connections/native_jdbc_mysql/connection.rb
135
+ test/db/db2.rb
136
+ test/db/derby.rb
137
+ test/db/h2.rb
138
+ test/db/hsqldb.rb
139
+ test/db/informix.rb
140
+ test/db/jdbc.rb
141
+ test/db/jndi_config.rb
142
+ test/db/logger.rb
143
+ test/db/mssql.rb
144
+ test/db/mysql.rb
145
+ test/db/oracle.rb
146
+ test/db/postgres.rb
147
+ test/db/sqlite3.rb
148
+ test/models/add_not_null_column_to_table.rb
149
+ test/models/auto_id.rb
150
+ test/models/data_types.rb
151
+ test/models/entry.rb
152
+ test/models/mixed_case.rb
153
+ test/models/reserved_word.rb
154
+ test/models/string_id.rb
155
+ test/models/validates_uniqueness_of_string.rb
156
+ lib/arjdbc/jdbc/jdbc.rake
157
+ src/java/arjdbc/derby/DerbyModule.java
158
+ src/java/arjdbc/h2/H2RubyJdbcConnection.java
159
+ src/java/arjdbc/informix/InformixRubyJdbcConnection.java
160
+ src/java/arjdbc/jdbc/AdapterJavaService.java
161
+ src/java/arjdbc/jdbc/JdbcConnectionFactory.java
162
+ src/java/arjdbc/jdbc/RubyJdbcConnection.java
163
+ src/java/arjdbc/jdbc/SQLBlock.java
164
+ src/java/arjdbc/mssql/MssqlRubyJdbcConnection.java
165
+ src/java/arjdbc/mysql/MySQLModule.java
166
+ src/java/arjdbc/mysql/MySQLRubyJdbcConnection.java
167
+ src/java/arjdbc/oracle/OracleRubyJdbcConnection.java
168
+ src/java/arjdbc/postgresql/PostgresqlRubyJdbcConnection.java
169
+ src/java/arjdbc/sqlite3/Sqlite3RubyJdbcConnection.java
110
170
  rakelib/compile.rake
171
+ rakelib/db.rake
111
172
  rakelib/package.rake
112
173
  rakelib/rails.rake
113
174
  rakelib/test.rake
114
175
  rails_generators/jdbc_generator.rb
115
176
  rails_generators/templates
116
- rails_generators/templates/jdbc.rake
117
- rails_generators/templates/jdbc.rb
177
+ rails_generators/templates/config
178
+ rails_generators/templates/lib
179
+ rails_generators/templates/config/initializers
180
+ rails_generators/templates/config/initializers/jdbc.rb
181
+ rails_generators/templates/lib/tasks
182
+ rails_generators/templates/lib/tasks/jdbc.rake
data/README.txt CHANGED
@@ -2,39 +2,11 @@ activerecord-jdbc-adapter is a database adapter for Rails' ActiveRecord
2
2
  component that can be used with JRuby[http://www.jruby.org/]. It allows use of
3
3
  virtually any JDBC-compliant database with your JRuby on Rails application.
4
4
 
5
- == Project Info
6
-
7
- * Mailing Lists: http://kenai.com/projects/activerecord-jdbc/lists
8
- * Issues: http://kenai.com/jira/browse/ACTIVERECORD_JDBC
9
- * Source: git://kenai.com/activerecord-jdbc~main
10
- git://github.com/nicksieger/activerecord-jdbc-adapter.git
11
-
12
5
  == Databases
13
6
 
14
- What's there, and what is not there:
15
-
16
- * MySQL - Complete support
17
- * PostgreSQL - Complete support
18
- * Oracle - Complete support
19
- * Microsoft SQL Server - Complete support except for change_column_default
20
- * DB2 - Complete, except for the migrations:
21
- * change_column
22
- * change_column_default
23
- * remove_column
24
- * rename_column
25
- * add_index
26
- * remove_index
27
- * rename_table
28
- * FireBird - Complete, except for change_column_default and rename_column
29
- * Derby - Complete, except for:
30
- * change_column
31
- * change_column_default
32
- * remove_column
33
- * rename_column
34
- * HSQLDB - Complete
35
- * H2 - Complete
36
- * SQLite3 - work in progress
37
- * Informix - Fairly complete support, all tests pass and migrations appear to work. Comments welcome.
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.
38
10
 
39
11
  Other databases will require testing and likely a custom configuration module.
40
12
  Please join the activerecord-jdbc
@@ -48,43 +20,45 @@ support for more databases.
48
20
  To use activerecord-jdbc-adapter with JRuby on Rails:
49
21
 
50
22
  1. Choose the adapter you wish to gem install. The following pre-packaged
51
- adapters are available:
23
+ adapters are available:
52
24
 
53
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.
54
26
  * mysql (<tt>activerecord-jdbcmysql-adapter</tt>)
55
27
  * postgresql (<tt>activerecord-jdbcpostgresql-adapter</tt>)
28
+ * sqlite3 (<tt>activerecord-jdbcsqlite3-adapter</tt>)
56
29
  * derby (<tt>activerecord-jdbcderby-adapter</tt>)
57
30
  * hsqldb (<tt>activerecord-jdbchsqldb-adapter</tt>)
58
31
  * h2 (<tt>activerecord-jdbch2-adapter</tt>)
59
- * sqlite3 (<tt>activerecord-jdbcsqlite3-adapter</tt>)
32
+ * mssql (<tt>activerecord-jdbcmssql-adapter</tt>)
60
33
 
61
- 2. Run the "jdbc" generator to prepare your Rails application for
62
- JDBC.
34
+ 2a. For Rails 3, if you're generating a new application, use the
35
+ following command to generate your application:
63
36
 
64
- jruby script/generate jdbc
65
-
66
- The initializer and rake task files generated are guarded such that
67
- they won't be loaded if you still run your application un C Ruby.
68
-
69
- Legacy: If you're using Rails prior to version 2.0, you'll need to
70
- add one-time setup to your config/environment.rb file in your Rails
71
- application. Add the following lines just before the
72
- <code>Rails::Initializer</code>. (If you're using
73
- activerecord-jdbc-adapter under the old gem name used in versions
74
- 0.5 and earlier (ActiveRecord-JDBC), replace
75
- 'activerecord-jdbc-adapter' with 'ActiveRecord-JDBC' below.)
76
-
77
- if RUBY_PLATFORM =~ /java/
78
- require 'rubygems'
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)
79
47
  gem 'activerecord-jdbc-adapter'
80
- require 'jdbc_adapter'
48
+ gem 'jdbc-sqlite3'
49
+ else
50
+ gem 'sqlite3-ruby', :require => 'sqlite3'
81
51
  end
82
52
 
53
+ If you're using Rails 2:
54
+
55
+ jruby script/generate jdbc
56
+
83
57
  3. Configure your database.yml in the normal Rails style.
84
58
 
85
- Legacy configuration: If you use one of the convenience
86
- 'activerecord-jdbcXXX-adapter' adapters, you can still put a 'jdbc'
87
- prefix in front of the databas adapter name as below.
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.
88
62
 
89
63
  development:
90
64
  adapter: jdbcmysql
@@ -93,8 +67,8 @@ To use activerecord-jdbc-adapter with JRuby on Rails:
93
67
  hostname: localhost
94
68
  database: weblog_development
95
69
 
96
- For other databases, you'll need to know the database driver class
97
- and URL. Example:
70
+ For other databases, you'll need to know the database driver class and
71
+ URL. Example:
98
72
 
99
73
  development:
100
74
  adapter: jdbc
@@ -103,33 +77,32 @@ To use activerecord-jdbc-adapter with JRuby on Rails:
103
77
  driver: com.mysql.jdbc.Driver
104
78
  url: jdbc:mysql://localhost:3306/weblog_development
105
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
+
106
87
  === Standalone, with ActiveRecord
107
88
 
108
89
  1. Install the gem with JRuby:
109
90
 
110
91
  jruby -S gem install activerecord-jdbc-adapter
111
92
 
112
- If you wish to use the adapter for a specific database, you can install it
113
- directly and a driver gem will be installed as well:
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:
114
95
 
115
96
  jruby -S gem install activerecord-jdbcderby-adapter
116
97
 
117
- 2. If using ActiveRecord 2.0 (Rails 2.0) or greater, you can skip to the next
118
- step. Otherwise, ensure the following code gets executed in your script:
119
-
120
- require 'rubygems'
121
- gem 'activerecord-jdbc-adapter'
122
- require 'jdbc_adapter'
123
- require 'active_record'
124
-
125
- 3. After this you can establish a JDBC connection like this:
98
+ 2. After this you can establish a JDBC connection like this:
126
99
 
127
100
  ActiveRecord::Base.establish_connection(
128
101
  :adapter => 'jdbcderby',
129
102
  :database => "db/my-database"
130
103
  )
131
104
 
132
- or like this (but requires that you manually put the driver jar on the classpath):
105
+ or like this (but requires that you manually put the driver jar on the classpath):
133
106
 
134
107
  ActiveRecord::Base.establish_connection(
135
108
  :adapter => 'jdbc',
@@ -137,6 +110,15 @@ To use activerecord-jdbc-adapter with JRuby on Rails:
137
110
  :url => 'jdbc:derby:test_ar;create=true'
138
111
  )
139
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
+
140
122
  == Getting the source
141
123
 
142
124
  The source for activerecord-jdbc-adapter is available using git.
@@ -149,12 +131,22 @@ Please file bug reports at
149
131
  http://kenai.com/jira/browse/ACTIVERECORD_JDBC. If you're not sure if
150
132
  something's a bug, feel free to pre-report it on the mailing lists.
151
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
+
152
142
  == Running AR-JDBC's Tests
153
143
 
154
- Drivers for 6 open-source databases are included. Provided you have MySQL
155
- installed, you can simply type <tt>jruby -S rake</tt> to run the tests. A
156
- database named <tt>weblog_development</tt> is needed beforehand with a
157
- connection user of "blog" and an empty password.
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.*'.
158
150
 
159
151
  If you also have PostgreSQL available, those tests will be run if the
160
152
  `psql' executable can be found. Also ensure you have a database named