activerecord-jdbc-alt-adapter 50.3.0-java → 50.3.1-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/README.md +37 -7
- data/lib/arjdbc/jdbc/adapter_java.jar +0 -0
- data/lib/arjdbc/version.rb +1 -1
- data/src/java/arjdbc/mssql/MSSQLRubyJdbcConnection.java +2 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92dac2edfcfed4dc0eb6a9cc29a7b09d1b9353dc8c81f9a83354d8483a29d693
|
4
|
+
data.tar.gz: 655f68ee07612be8dde98751a301a73cb000202b177c2caccdd096ad73ddb734
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 771a171b82db726fc727075a4b84f5c4772565b7005682bda6ea017f1464e7c3ab7d6b933f23943a534aac5e70c72d88df3fd173d417beff5d9325b8f8a10a61
|
7
|
+
data.tar.gz: de350c94d7eeda43af9e55eda5db8cc53c6a2ff16607a40c7a27850194c8845edd5f96f58be4b8be4fa30a07709cf023078df1cb584bd1019303d484d12e10a3
|
data/README.md
CHANGED
@@ -11,12 +11,16 @@ use the [original adapter](https://github.com/jruby/activerecord-jdbc-adapter)
|
|
11
11
|
|
12
12
|
Add the following to your `Gemfile`:
|
13
13
|
|
14
|
-
```
|
15
|
-
|
16
|
-
|
17
|
-
gem 'jdbc-
|
14
|
+
```ruby
|
15
|
+
platforms :jruby do
|
16
|
+
# Use jdbc as the database for Active Record
|
17
|
+
gem 'activerecord-jdbc-alt-adapter', '~> 50.3.1', require: 'arjdbc'
|
18
|
+
gem 'jdbc-mssql', '~> 0.6.0'
|
19
|
+
end
|
18
20
|
```
|
19
21
|
|
22
|
+
Or look at the sample rails 5.0 app [wombat](https://github.com/JesseChavez/wombat50)
|
23
|
+
and see how is set up.
|
20
24
|
|
21
25
|
### Breaking changes
|
22
26
|
|
@@ -31,6 +35,16 @@ gem 'jdbc-mssql', '~> 0.6.0'
|
|
31
35
|
|
32
36
|
### Recommendation
|
33
37
|
|
38
|
+
If you have the old sql server `datetime` data type for created_at and
|
39
|
+
updated_at, you don't need to be upgraded straightaway to `datetime2`, the old data type
|
40
|
+
(`datetime_basic`) will still work fine, just make you add to the time zone
|
41
|
+
aware list.
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
# time zone aware configuration.
|
45
|
+
config.active_record.time_zone_aware_types = [:datetime, :datetime_basic]
|
46
|
+
```
|
47
|
+
|
34
48
|
In order to avoid deadlocks it is advised to use `SET READ_COMMITTED_SNAPSHOT ON`
|
35
49
|
Make sure to run `ALTER DATABASE your_db SET READ_COMMITTED_SNAPSHOT ON` against
|
36
50
|
your database.
|
@@ -44,8 +58,9 @@ If you have slow queries on your background jobs and locking queries you can cha
|
|
44
58
|
|
45
59
|
database config example (`database.yml`):
|
46
60
|
|
61
|
+
|
47
62
|
```yml
|
48
|
-
# SQL Server (2012 or higher
|
63
|
+
# SQL Server (2012 or higher)
|
49
64
|
|
50
65
|
default: &default
|
51
66
|
adapter: sqlserver
|
@@ -54,13 +69,28 @@ default: &default
|
|
54
69
|
development:
|
55
70
|
<<: *default
|
56
71
|
host: localhost
|
57
|
-
database:
|
58
|
-
username:
|
72
|
+
database: sam_development
|
73
|
+
username: SA
|
59
74
|
password: password
|
60
75
|
transaction_isolation: read_uncommitted
|
61
76
|
lock_timeout: 10000
|
77
|
+
|
78
|
+
test:
|
79
|
+
<<: *default
|
80
|
+
host: localhost
|
81
|
+
database: sam_test
|
82
|
+
username: SA
|
83
|
+
password: password
|
84
|
+
|
85
|
+
production:
|
86
|
+
<<: *default
|
87
|
+
host: localhost
|
88
|
+
database: sam_production
|
89
|
+
username:
|
90
|
+
password:
|
62
91
|
```
|
63
92
|
|
93
|
+
|
64
94
|
### WARNING
|
65
95
|
|
66
96
|
Keep one eye in the Rails connection pool, we have not thoroughly tested that
|
Binary file
|
data/lib/arjdbc/version.rb
CHANGED
@@ -424,6 +424,8 @@ public class MSSQLRubyJdbcConnection extends RubyJdbcConnection {
|
|
424
424
|
protected String mapTypeToString(final IRubyObject type) {
|
425
425
|
final String typeStr = type.asJavaString();
|
426
426
|
|
427
|
+
if (typeStr == "datetime_basic") return "datetime";
|
428
|
+
|
427
429
|
if (typeStr == "smalldatetime") return "datetime";
|
428
430
|
|
429
431
|
return typeStr;
|
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: 50.3.
|
4
|
+
version: 50.3.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: 2019-05-
|
11
|
+
date: 2019-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -262,7 +262,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
262
262
|
version: '0'
|
263
263
|
requirements: []
|
264
264
|
rubyforge_project:
|
265
|
-
rubygems_version: 2.7.
|
265
|
+
rubygems_version: 2.7.6
|
266
266
|
signing_key:
|
267
267
|
specification_version: 4
|
268
268
|
summary: ActiveRecord JDBC adapter, for use within JRuby on Rails and SQL Server
|