activerecord-jdbc-adapter 50.8-java → 51.1-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -2
  3. data/.travis.yml +26 -51
  4. data/Gemfile +3 -1
  5. data/README.md +9 -11
  6. data/Rakefile +15 -78
  7. data/activerecord-jdbc-adapter.gemspec +2 -2
  8. data/lib/active_record/connection_adapters/mssql_adapter.rb +1 -0
  9. data/lib/active_record/connection_adapters/sqlserver_adapter.rb +1 -0
  10. data/lib/arjdbc/abstract/core.rb +4 -12
  11. data/lib/arjdbc/abstract/database_statements.rb +4 -10
  12. data/lib/arjdbc/abstract/statement_cache.rb +4 -4
  13. data/lib/arjdbc/abstract/transaction_support.rb +2 -9
  14. data/lib/arjdbc/jdbc.rb +4 -0
  15. data/lib/arjdbc/jdbc/column.rb +11 -5
  16. data/lib/arjdbc/jdbc/connection_methods.rb +9 -2
  17. data/lib/arjdbc/jdbc/error.rb +1 -1
  18. data/lib/arjdbc/jdbc/jdbc.rake +4 -0
  19. data/lib/arjdbc/mssql.rb +7 -0
  20. data/lib/arjdbc/mssql/adapter.rb +804 -0
  21. data/lib/arjdbc/mssql/column.rb +200 -0
  22. data/lib/arjdbc/mssql/connection_methods.rb +79 -0
  23. data/lib/arjdbc/mssql/explain_support.rb +99 -0
  24. data/lib/arjdbc/mssql/limit_helpers.rb +231 -0
  25. data/lib/arjdbc/mssql/lock_methods.rb +77 -0
  26. data/lib/arjdbc/mssql/types.rb +343 -0
  27. data/lib/arjdbc/mssql/utils.rb +82 -0
  28. data/lib/arjdbc/mysql/adapter.rb +14 -11
  29. data/lib/arjdbc/mysql/connection_methods.rb +9 -18
  30. data/lib/arjdbc/postgresql/adapter.rb +108 -59
  31. data/lib/arjdbc/postgresql/column.rb +3 -6
  32. data/lib/arjdbc/postgresql/connection_methods.rb +3 -12
  33. data/lib/arjdbc/postgresql/oid_types.rb +14 -93
  34. data/lib/arjdbc/sqlite3/adapter.rb +171 -140
  35. data/lib/arjdbc/sqlite3/connection_methods.rb +1 -2
  36. data/lib/arjdbc/tasks/database_tasks.rb +36 -16
  37. data/lib/arjdbc/tasks/databases.rake +75 -32
  38. data/lib/arjdbc/tasks/databases3.rake +215 -0
  39. data/lib/arjdbc/tasks/databases4.rake +39 -0
  40. data/lib/arjdbc/version.rb +1 -1
  41. data/rakelib/01-tomcat.rake +2 -2
  42. data/rakelib/02-test.rake +3 -0
  43. data/rakelib/compile.rake +70 -0
  44. data/rakelib/db.rake +7 -21
  45. data/rakelib/rails.rake +4 -5
  46. data/src/java/arjdbc/ArJdbcModule.java +15 -5
  47. data/src/java/arjdbc/derby/DerbyRubyJdbcConnection.java +2 -2
  48. data/src/java/arjdbc/jdbc/ConnectionFactory.java +87 -0
  49. data/src/java/arjdbc/jdbc/DataSourceConnectionFactory.java +1 -0
  50. data/src/java/arjdbc/jdbc/RubyJdbcConnection.java +41 -120
  51. data/src/java/arjdbc/mssql/MSSQLRubyJdbcConnection.java +14 -310
  52. data/src/java/arjdbc/mysql/MySQLRubyJdbcConnection.java +2 -2
  53. data/src/java/arjdbc/postgresql/ByteaUtils.java +1 -0
  54. data/src/java/arjdbc/postgresql/PgResultSetMetaDataWrapper.java +23 -0
  55. data/src/java/arjdbc/postgresql/PostgreSQLResult.java +13 -21
  56. data/src/java/arjdbc/postgresql/PostgreSQLRubyJdbcConnection.java +46 -41
  57. data/src/java/arjdbc/util/DateTimeUtils.java +5 -141
  58. data/src/java/arjdbc/util/QuotingUtils.java +7 -6
  59. data/src/java/arjdbc/util/StringHelper.java +20 -6
  60. metadata +25 -16
  61. data/src/java/arjdbc/jdbc/RubyConnectionFactory.java +0 -61
  62. data/src/java/arjdbc/postgresql/PgDateTimeUtils.java +0 -52
metadata CHANGED
@@ -1,35 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-jdbc-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: '50.8'
4
+ version: '51.1'
5
5
  platform: java
6
6
  authors:
7
7
  - Nick Sieger, Ola Bini, Karol Bucek and JRuby contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-17 00:00:00.000000000 Z
11
+ date: 2018-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
+ name: activerecord
14
15
  requirement: !ruby/object:Gem::Requirement
15
16
  requirements:
16
17
  - - "~>"
17
18
  - !ruby/object:Gem::Version
18
- version: 5.0.0
19
- - - ">="
20
- - !ruby/object:Gem::Version
21
- version: 5.0.3
22
- name: activerecord
23
- type: :runtime
24
- prerelease: false
19
+ version: 5.1.0
25
20
  version_requirements: !ruby/object:Gem::Requirement
26
21
  requirements:
27
22
  - - "~>"
28
23
  - !ruby/object:Gem::Version
29
- version: 5.0.0
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 5.0.3
24
+ version: 5.1.0
25
+ prerelease: false
26
+ type: :runtime
33
27
  description: 'AR-JDBC is a database adapter for Rails'' ActiveRecord component designed
34
28
  to be used with JRuby built upon Java''s JDBC API for database access. Provides
35
29
  (ActiveRecord) built-in adapters: MySQL, PostgreSQL and SQLite3 as well as adapters
@@ -66,10 +60,12 @@ files:
66
60
  - lib/active_record/connection_adapters/jdbc_adapter.rb
67
61
  - lib/active_record/connection_adapters/jndi_adapter.rb
68
62
  - lib/active_record/connection_adapters/mariadb_adapter.rb
63
+ - lib/active_record/connection_adapters/mssql_adapter.rb
69
64
  - lib/active_record/connection_adapters/mysql2_adapter.rb
70
65
  - lib/active_record/connection_adapters/mysql_adapter.rb
71
66
  - lib/active_record/connection_adapters/postgresql_adapter.rb
72
67
  - lib/active_record/connection_adapters/sqlite3_adapter.rb
68
+ - lib/active_record/connection_adapters/sqlserver_adapter.rb
73
69
  - lib/activerecord-jdbc-adapter.rb
74
70
  - lib/arel/visitors/compat.rb
75
71
  - lib/arel/visitors/db2.rb
@@ -123,11 +119,21 @@ files:
123
119
  - lib/arjdbc/jdbc/error.rb
124
120
  - lib/arjdbc/jdbc/extension.rb
125
121
  - lib/arjdbc/jdbc/java.rb
122
+ - lib/arjdbc/jdbc/jdbc.rake
126
123
  - lib/arjdbc/jdbc/railtie.rb
127
124
  - lib/arjdbc/jdbc/rake_tasks.rb
128
125
  - lib/arjdbc/jdbc/serialized_attributes_helper.rb
129
126
  - lib/arjdbc/jdbc/type_cast.rb
130
127
  - lib/arjdbc/jdbc/type_converter.rb
128
+ - lib/arjdbc/mssql.rb
129
+ - lib/arjdbc/mssql/adapter.rb
130
+ - lib/arjdbc/mssql/column.rb
131
+ - lib/arjdbc/mssql/connection_methods.rb
132
+ - lib/arjdbc/mssql/explain_support.rb
133
+ - lib/arjdbc/mssql/limit_helpers.rb
134
+ - lib/arjdbc/mssql/lock_methods.rb
135
+ - lib/arjdbc/mssql/types.rb
136
+ - lib/arjdbc/mssql/utils.rb
131
137
  - lib/arjdbc/mysql.rb
132
138
  - lib/arjdbc/mysql/adapter.rb
133
139
  - lib/arjdbc/mysql/connection_methods.rb
@@ -151,6 +157,8 @@ files:
151
157
  - lib/arjdbc/tasks.rb
152
158
  - lib/arjdbc/tasks/database_tasks.rb
153
159
  - lib/arjdbc/tasks/databases.rake
160
+ - lib/arjdbc/tasks/databases3.rake
161
+ - lib/arjdbc/tasks/databases4.rake
154
162
  - lib/arjdbc/tasks/db2_database_tasks.rb
155
163
  - lib/arjdbc/tasks/derby_database_tasks.rb
156
164
  - lib/arjdbc/tasks/h2_database_tasks.rb
@@ -173,6 +181,7 @@ files:
173
181
  - rakelib/01-tomcat.rake
174
182
  - rakelib/02-test.rake
175
183
  - rakelib/bundler_ext.rb
184
+ - rakelib/compile.rake
176
185
  - rakelib/db.rake
177
186
  - rakelib/rails.rake
178
187
  - src/java/arjdbc/ArJdbcModule.java
@@ -192,7 +201,6 @@ files:
192
201
  - src/java/arjdbc/jdbc/DriverConnectionFactory.java
193
202
  - src/java/arjdbc/jdbc/DriverWrapper.java
194
203
  - src/java/arjdbc/jdbc/JdbcResult.java
195
- - src/java/arjdbc/jdbc/RubyConnectionFactory.java
196
204
  - src/java/arjdbc/jdbc/RubyJdbcConnection.java
197
205
  - src/java/arjdbc/mssql/MSSQLModule.java
198
206
  - src/java/arjdbc/mssql/MSSQLRubyJdbcConnection.java
@@ -201,7 +209,7 @@ files:
201
209
  - src/java/arjdbc/oracle/OracleModule.java
202
210
  - src/java/arjdbc/oracle/OracleRubyJdbcConnection.java
203
211
  - src/java/arjdbc/postgresql/ByteaUtils.java
204
- - src/java/arjdbc/postgresql/PgDateTimeUtils.java
212
+ - src/java/arjdbc/postgresql/PgResultSetMetaDataWrapper.java
205
213
  - src/java/arjdbc/postgresql/PostgreSQLModule.java
206
214
  - src/java/arjdbc/postgresql/PostgreSQLResult.java
207
215
  - src/java/arjdbc/postgresql/PostgreSQLRubyJdbcConnection.java
@@ -237,7 +245,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
245
  - !ruby/object:Gem::Version
238
246
  version: '0'
239
247
  requirements: []
240
- rubygems_version: 3.0.6
248
+ rubyforge_project:
249
+ rubygems_version: 2.6.14.1
241
250
  signing_key:
242
251
  specification_version: 4
243
252
  summary: JDBC adapter for ActiveRecord, for use within JRuby on Rails.
@@ -1,61 +0,0 @@
1
- /***** BEGIN LICENSE BLOCK *****
2
- * Copyright (c) 2012-2014 Karol Bucek <self@kares.org>
3
- * Copyright (c) 2006-2010 Nick Sieger <nick@nicksieger.com>
4
- * Copyright (c) 2006-2007 Ola Bini <ola.bini@gmail.com>
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining
7
- * a copy of this software and associated documentation files (the
8
- * "Software"), to deal in the Software without restriction, including
9
- * without limitation the rights to use, copy, modify, merge, publish,
10
- * distribute, sublicense, and/or sell copies of the Software, and to
11
- * permit persons to whom the Software is furnished to do so, subject to
12
- * the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be
15
- * included in all copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
- ***** END LICENSE BLOCK *****/
25
-
26
- package arjdbc.jdbc;
27
-
28
- import java.sql.Connection;
29
- import java.sql.SQLException;
30
-
31
- import org.jruby.RubyObject;
32
- import org.jruby.RubyString;
33
- import org.jruby.runtime.ThreadContext;
34
- import org.jruby.runtime.builtin.IRubyObject;
35
-
36
- // @legacy ActiveRecord::ConnectionAdapters::JdbcDriver
37
- class RubyConnectionFactory implements ConnectionFactory {
38
-
39
- private final IRubyObject driver;
40
- final RubyString url;
41
- final IRubyObject username, password; // null allowed
42
-
43
- private final RubyObject contextProvider;
44
-
45
- public RubyConnectionFactory(final IRubyObject driver, final RubyString url,
46
- final IRubyObject username, final IRubyObject password) {
47
- this.driver = driver; this.url = url;
48
- this.username = username; this.password = password;
49
- contextProvider = (RubyObject) driver;
50
- }
51
-
52
- @Override
53
- public Connection newConnection() throws SQLException {
54
- final ThreadContext context = contextProvider.getRuntime().getCurrentContext();
55
- final IRubyObject connection = driver.callMethod(context, "connection", new IRubyObject[] { url, username, password });
56
- return (Connection) connection.toJava(Connection.class);
57
- }
58
-
59
- IRubyObject getDriver() { return driver; } /* for tests */
60
-
61
- }
@@ -1,52 +0,0 @@
1
- package arjdbc.postgresql;
2
-
3
- import arjdbc.util.DateTimeUtils;
4
- import org.joda.time.DateTimeZone;
5
- import org.jruby.RubyArray;
6
- import org.jruby.RubyFloat;
7
- import org.jruby.runtime.ThreadContext;
8
- import org.jruby.runtime.builtin.IRubyObject;
9
-
10
- /**
11
- * PostgreSQL specific DateTime/Timestamp helpers
12
- * @author dritz
13
- */
14
- public abstract class PgDateTimeUtils extends DateTimeUtils {
15
- /**
16
- * Convert a ruby value to a PostgreSQL timestamp string
17
- * @param context
18
- * @param value Ruby value, typically a Time instance
19
- * @param zone DateTimeZone to adjust to, optional
20
- * @param withZone include timezone in string?
21
- * @return A string fit for PostgreSQL
22
- */
23
- public static String timestampValueToString(final ThreadContext context, IRubyObject value, DateTimeZone zone,
24
- boolean withZone) {
25
- if (value instanceof RubyFloat) {
26
- final double dv = ((RubyFloat) value).getValue();
27
- if (dv == Double.POSITIVE_INFINITY) {
28
- return "infinity";
29
- } else if (dv == Double.NEGATIVE_INFINITY) {
30
- return "-infinity";
31
- }
32
- }
33
- return timestampTimeToString(context, value, zone, withZone);
34
- }
35
-
36
- /**
37
- * Converts a RubyArray with timestamp values to a java array of PostgreSQL timestamp strings
38
- * @param context
39
- * @param rubyArray
40
- * @return Array of timestamp strings
41
- */
42
- public static String[] timestampStringArray(final ThreadContext context, final RubyArray rubyArray) {
43
- int size = rubyArray.size();
44
- String[] values = new String[size];
45
-
46
- for (int i = 0; i < size; i++) {
47
- IRubyObject elem = rubyArray.eltInternal(i);
48
- values[i] = timestampValueToString(context, elem, DateTimeZone.UTC, false);
49
- }
50
- return values;
51
- }
52
- }