activerecord-jdbcsqlserver-adapter 50.0.0 → 50.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/activerecord-jdbcsqlserver-adapter.gemspec +1 -1
- data/lib/activerecord-jdbcsqlserver-adapter.rb +1 -1
- data/lib/jdbc_mssql_driver_loader.rb +22 -0
- data/test/cases/adapter_test_sqlserver.rb +1 -2
- data/test/cases/helper_sqlserver.rb +1 -1
- data/test/support/sql_counter_sqlserver.rb +1 -2
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a5acd7cd424c10d62f5c2c1b71c8375fd736ed7ec7793c85a3fd6dc0f0f23f6
|
4
|
+
data.tar.gz: 597ccc6cfb6d8533555dda1eb7598132cd932f80c78f936b85b69daef9545271
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c55e61e720f4de8c51cd94a34be67eb16b3d9d1c34888471e8eb14e3fc1f590eb404b90f7cc19a16534a135ab3665dc57ea1551e78c49777ff3d678816d888e9
|
7
|
+
data.tar.gz: a731bb86cac95cb46e1876b65ff7740f855c0759fd0751ee08fcb7f4f5497247ad8e6633671d7ab468289770bea319656a64ce8934f42b0b9b512bb8171fa91b
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
50.
|
1
|
+
50.1.0
|
@@ -16,6 +16,6 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
17
17
|
spec.require_paths = ['lib']
|
18
18
|
spec.add_dependency 'activerecord', '~> 5.0.0', '>= 5.0.6'
|
19
|
-
spec.add_dependency 'activerecord-jdbc-adapter' , '~> 50.
|
19
|
+
spec.add_dependency 'activerecord-jdbc-adapter' , '~> 50.8'
|
20
20
|
spec.add_dependency 'jdbc-mssql', '>= 0.6.0'
|
21
21
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
require 'active_record/connection_adapters/sqlserver/core_ext/date_time'
|
3
3
|
|
4
4
|
# Load the jar file for the jdbc driver
|
5
|
-
|
5
|
+
require_relative './jdbc_mssql_driver_loader'
|
6
6
|
|
7
7
|
# Standadard arjdbc functionality
|
8
8
|
require 'arjdbc/abstract/connection_management'
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module JdbcMssqlDriverLoader
|
2
|
+
def self.check_and_maybe_load_driver
|
3
|
+
driver_name = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
|
4
|
+
if (Java::JavaClass.for_name(driver_name) rescue nil)
|
5
|
+
driver = Java::ComMicrosoftSqlserverJdbc::SQLServerDriver.new
|
6
|
+
which = driver
|
7
|
+
.getClass().getClassLoader().loadClass(driver_name)
|
8
|
+
.getProtectionDomain().getCodeSource().getLocation().to_s
|
9
|
+
warn "You already required a mssql jdbc driver (#{which}), skipping gem jdbc-mssql"
|
10
|
+
|
11
|
+
major_version = driver.major_version
|
12
|
+
required_major_version = 8
|
13
|
+
if major_version < required_major_version
|
14
|
+
raise "MSSQL jdbc driver version is to old (given major version #{major_version} < required major version #{required_major_version})"
|
15
|
+
end
|
16
|
+
else
|
17
|
+
require "jdbc/mssql"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
check_and_maybe_load_driver
|
22
|
+
end
|
@@ -16,7 +16,7 @@ class AdapterTestSQLServer < ActiveRecord::TestCase
|
|
16
16
|
it 'has basic and non-senstive information in the adpaters inspect method' do
|
17
17
|
string = connection.inspect
|
18
18
|
string.must_match %r{ActiveRecord::ConnectionAdapters::SQLServerAdapter}
|
19
|
-
string.must_match %r{version\: \d
|
19
|
+
string.must_match %r{version\: \d\d\.\d}
|
20
20
|
string.must_match %r{mode: (dblib|jdbc)}
|
21
21
|
string.must_match %r{azure: (true|false)}
|
22
22
|
string.wont_match %r{host}
|
@@ -427,4 +427,3 @@ class AdapterTestSQLServer < ActiveRecord::TestCase
|
|
427
427
|
end
|
428
428
|
|
429
429
|
end
|
430
|
-
|
@@ -9,7 +9,7 @@ require 'support/load_schema_sqlserver'
|
|
9
9
|
require 'support/coerceable_test_sqlserver'
|
10
10
|
require 'support/sql_counter_sqlserver'
|
11
11
|
require 'support/connection_reflection'
|
12
|
-
require 'mocha/
|
12
|
+
require 'mocha/minitest'
|
13
13
|
|
14
14
|
module ActiveRecord
|
15
15
|
class TestCase < ActiveSupport::TestCase
|
@@ -21,8 +21,7 @@ module ARTest
|
|
21
21
|
/SELECT DATABASEPROPERTYEX/im
|
22
22
|
]
|
23
23
|
|
24
|
-
|
25
|
-
sqlcounter.instance_variable_set :@ignore, Regexp.union(ignored_sql.push(sqlcounter.ignore))
|
24
|
+
ActiveRecord::SQLCounter.ignored_sql.concat(ignored_sql)
|
26
25
|
|
27
26
|
end
|
28
27
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-jdbcsqlserver-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 50.
|
4
|
+
version: 50.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ken Collins
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date:
|
18
|
+
date: 2020-12-18 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
requirement: !ruby/object:Gem::Requirement
|
@@ -27,8 +27,8 @@ dependencies:
|
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: 5.0.6
|
29
29
|
name: activerecord
|
30
|
-
prerelease: false
|
31
30
|
type: :runtime
|
31
|
+
prerelease: false
|
32
32
|
version_requirements: !ruby/object:Gem::Requirement
|
33
33
|
requirements:
|
34
34
|
- - "~>"
|
@@ -42,15 +42,15 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - "~>"
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: '50.
|
45
|
+
version: '50.8'
|
46
46
|
name: activerecord-jdbc-adapter
|
47
|
-
prerelease: false
|
48
47
|
type: :runtime
|
48
|
+
prerelease: false
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '50.
|
53
|
+
version: '50.8'
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
@@ -58,8 +58,8 @@ dependencies:
|
|
58
58
|
- !ruby/object:Gem::Version
|
59
59
|
version: 0.6.0
|
60
60
|
name: jdbc-mssql
|
61
|
-
prerelease: false
|
62
61
|
type: :runtime
|
62
|
+
prerelease: false
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - ">="
|
@@ -156,6 +156,7 @@ files:
|
|
156
156
|
- lib/activerecord-sqlserver-adapter.rb
|
157
157
|
- lib/arel/visitors/sqlserver.rb
|
158
158
|
- lib/arel_sqlserver.rb
|
159
|
+
- lib/jdbc_mssql_driver_loader.rb
|
159
160
|
- test/appveyor/dbsetup.ps1
|
160
161
|
- test/appveyor/dbsetup.sql
|
161
162
|
- test/bin/wait-for.sh
|