activerecord-jdbc-alt-adapter 52.5.1-java → 52.6.0-java
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.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/README.md +5 -5
- data/lib/arjdbc/version.rb +1 -1
- data/rakelib/01-tomcat.rake +2 -2
- data/src/java/arjdbc/jdbc/RubyJdbcConnection.java +1 -1
- data/src/java/arjdbc/mssql/MSSQLRubyJdbcConnection.java +51 -0
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bbef112a6aaadd08c19169b2e2b1826e99a44f38f2d2b2e3b441383ab95b91b
|
4
|
+
data.tar.gz: 444be17b783f8b937d57cdbd47260b79f4d69a75117523b4848ec9171d082c85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc41292328eb23e4d84a13fcc5213c1a44780ee974c207b930ca17357304f7feef2497a3642c231ef350d91d371e631a108e72d74da8d5c734d5f3194257c76c
|
7
|
+
data.tar.gz: d2a6656b88aa2432a54b9de7b27066847136de6857b6848901d3f3551dd65f5aa92787dfc9f83c7e44195509faf86416eb59ef9a04627499dc4883388882df04
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -8,9 +8,9 @@ use the [original adapter](https://github.com/jruby/active)
|
|
8
8
|
This adapter only works with JRuby and it is advised to install the latest
|
9
9
|
stable versions of Rails
|
10
10
|
|
11
|
-
- For Rails `5.0.7
|
12
|
-
- For Rails `5.1.7` install the `51.
|
13
|
-
- For Rails `5.2.
|
11
|
+
- For Rails `5.0.7` install the `50.7.0` version of this adapter
|
12
|
+
- For Rails `5.1.7` install the `51.7.0` version of this adapter
|
13
|
+
- For Rails `5.2.4` install the `52.6.0` version of this adapter
|
14
14
|
|
15
15
|
Support for Rails 6.0 is planned in the future.
|
16
16
|
|
@@ -24,8 +24,8 @@ Add the following to your `Gemfile`:
|
|
24
24
|
```ruby
|
25
25
|
platforms :jruby do
|
26
26
|
# Use jdbc as the database for Active Record
|
27
|
-
gem 'activerecord-jdbc-alt-adapter', '~>
|
28
|
-
gem 'jdbc-mssql', '~> 0.
|
27
|
+
gem 'activerecord-jdbc-alt-adapter', '~> 52.6.0'
|
28
|
+
gem 'jdbc-mssql', '~> 0.9.0'
|
29
29
|
end
|
30
30
|
```
|
31
31
|
|
data/lib/arjdbc/version.rb
CHANGED
data/rakelib/01-tomcat.rake
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
namespace :'tomcat-jndi' do # contains a FS JNDI impl (for tests)
|
2
2
|
|
3
|
-
TOMCAT_MAVEN_REPO = '
|
3
|
+
TOMCAT_MAVEN_REPO = 'https://repo1.maven.org/maven2/org/apache/tomcat'
|
4
4
|
TOMCAT_VERSION = '7.0.54'
|
5
5
|
|
6
6
|
DOWNLOAD_DIR = File.expand_path('../test/jars', File.dirname(__FILE__))
|
@@ -48,4 +48,4 @@ namespace :'tomcat-jndi' do # contains a FS JNDI impl (for tests)
|
|
48
48
|
rm jar_path if File.exist?(jar_path)
|
49
49
|
end
|
50
50
|
|
51
|
-
end
|
51
|
+
end
|
@@ -2348,7 +2348,7 @@ public class RubyJdbcConnection extends RubyObject {
|
|
2348
2348
|
return RubyString.newString(runtime, DateTimeUtils.dateToString(value));
|
2349
2349
|
}
|
2350
2350
|
|
2351
|
-
return DateTimeUtils.newDateAsTime(context, value,
|
2351
|
+
return DateTimeUtils.newDateAsTime(context, value, DateTimeZone.UTC).callMethod(context, "to_date");
|
2352
2352
|
}
|
2353
2353
|
|
2354
2354
|
protected IRubyObject timeToRuby(final ThreadContext context,
|
@@ -203,6 +203,57 @@ public class MSSQLRubyJdbcConnection extends RubyJdbcConnection {
|
|
203
203
|
});
|
204
204
|
}
|
205
205
|
|
206
|
+
/**
|
207
|
+
* Executes an INSERT SQL statement
|
208
|
+
* @param context
|
209
|
+
* @param sql
|
210
|
+
* @param pk Rails PK
|
211
|
+
* @return ActiveRecord::Result
|
212
|
+
* @throws SQLException
|
213
|
+
*/
|
214
|
+
@Override
|
215
|
+
@JRubyMethod(name = "execute_insert_pk", required = 2)
|
216
|
+
public IRubyObject execute_insert_pk(final ThreadContext context, final IRubyObject sql, final IRubyObject pk) {
|
217
|
+
|
218
|
+
// MSSQL does not like composite primary keys here so chop it if there is more than one column
|
219
|
+
IRubyObject modifiedPk = pk;
|
220
|
+
|
221
|
+
if (pk instanceof RubyArray) {
|
222
|
+
RubyArray ary = (RubyArray) pk;
|
223
|
+
if (ary.size() > 0) {
|
224
|
+
modifiedPk = ary.eltInternal(0);
|
225
|
+
}
|
226
|
+
}
|
227
|
+
|
228
|
+
return super.execute_insert_pk(context, sql, modifiedPk);
|
229
|
+
}
|
230
|
+
|
231
|
+
/**
|
232
|
+
* Executes an INSERT SQL statement using a prepared statement
|
233
|
+
* @param context
|
234
|
+
* @param sql
|
235
|
+
* @param binds RubyArray of values to be bound to the query
|
236
|
+
* @param pk Rails PK
|
237
|
+
* @return ActiveRecord::Result
|
238
|
+
* @throws SQLException
|
239
|
+
*/
|
240
|
+
@Override
|
241
|
+
@JRubyMethod(name = "execute_insert_pk", required = 3)
|
242
|
+
public IRubyObject execute_insert_pk(final ThreadContext context, final IRubyObject sql, final IRubyObject binds,
|
243
|
+
final IRubyObject pk) {
|
244
|
+
// MSSQL does not like composite primary keys here so chop it if there is more than one column
|
245
|
+
IRubyObject modifiedPk = pk;
|
246
|
+
|
247
|
+
if (pk instanceof RubyArray) {
|
248
|
+
RubyArray ary = (RubyArray) pk;
|
249
|
+
if (ary.size() > 0) {
|
250
|
+
modifiedPk = ary.eltInternal(0);
|
251
|
+
}
|
252
|
+
}
|
253
|
+
|
254
|
+
return super.execute_insert_pk(context, sql, binds, modifiedPk);
|
255
|
+
}
|
256
|
+
|
206
257
|
@Override
|
207
258
|
protected Integer jdbcTypeFor(final String type) {
|
208
259
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-jdbc-alt-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 52.
|
4
|
+
version: 52.6.0
|
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:
|
11
|
+
date: 2021-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -20,8 +20,8 @@ dependencies:
|
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: 5.2.3
|
22
22
|
name: activerecord
|
23
|
-
prerelease: false
|
24
23
|
type: :runtime
|
24
|
+
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - "~>"
|
@@ -273,8 +273,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
273
273
|
- !ruby/object:Gem::Version
|
274
274
|
version: '0'
|
275
275
|
requirements: []
|
276
|
-
|
277
|
-
rubygems_version: 2.7.10
|
276
|
+
rubygems_version: 3.0.6
|
278
277
|
signing_key:
|
279
278
|
specification_version: 4
|
280
279
|
summary: ActiveRecord JDBC adapter, for use within JRuby on Rails and SQL Server
|