activerecord-sqlserver-adapter 2.3.15 → 2.3.16
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -0
- data/Rakefile +1 -1
- data/lib/active_record/connection_adapters/sqlserver_adapter.rb +8 -12
- metadata +5 -5
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
@@ -9,12 +9,13 @@ module ActiveRecord
|
|
9
9
|
|
10
10
|
def self.sqlserver_connection(config) #:nodoc:
|
11
11
|
config = config.dup.symbolize_keys!
|
12
|
-
config.reverse_merge! :mode => :
|
12
|
+
config.reverse_merge! :mode => :dblib, :host => 'localhost', :username => 'sa', :password => ''
|
13
13
|
mode = config[:mode].to_s.downcase.underscore.to_sym
|
14
14
|
case mode
|
15
15
|
when :dblib
|
16
16
|
raise ArgumentError, 'Missing :dataserver configuration.' unless config.has_key?(:dataserver)
|
17
17
|
require_library_or_gem 'tiny_tds'
|
18
|
+
warn("TinyTds v0.4.3 or higher required. Using #{TinyTds::VERSION}") unless TinyTds::Client.instance_methods.include?("active?")
|
18
19
|
when :odbc
|
19
20
|
require_library_or_gem 'odbc' unless defined?(ODBC)
|
20
21
|
require 'active_record/connection_adapters/sqlserver_adapter/core_ext/odbc'
|
@@ -147,7 +148,7 @@ module ActiveRecord
|
|
147
148
|
class SQLServerAdapter < AbstractAdapter
|
148
149
|
|
149
150
|
ADAPTER_NAME = 'SQLServer'.freeze
|
150
|
-
VERSION = '2.3.
|
151
|
+
VERSION = '2.3.16'.freeze
|
151
152
|
DATABASE_VERSION_REGEXP = /Microsoft SQL Server\s+(\d{4})/
|
152
153
|
SUPPORTED_VERSIONS = [2000,2005,2008].freeze
|
153
154
|
LIMITABLE_TYPES = ['string','integer','float','char','nchar','varchar','nvarchar'].to_set.freeze
|
@@ -158,7 +159,7 @@ module ActiveRecord
|
|
158
159
|
:adonet => ['TypeError','System::Data::SqlClient::SqlException']
|
159
160
|
}
|
160
161
|
LOST_CONNECTION_MESSAGES = {
|
161
|
-
:dblib => [/closed connection/, /dead or not enabled/],
|
162
|
+
:dblib => [/closed connection/, /dead or not enabled/, /server failed/i],
|
162
163
|
:odbc => [/link failure/, /server failed/, /connection was already closed/, /invalid handle/i],
|
163
164
|
:adonet => [/current state is closed/, /network-related/]
|
164
165
|
}
|
@@ -319,15 +320,10 @@ module ActiveRecord
|
|
319
320
|
# CONNECTION MANAGEMENT ====================================#
|
320
321
|
|
321
322
|
def active?
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
true
|
327
|
-
else :adonet
|
328
|
-
true
|
329
|
-
end
|
330
|
-
return false if !connected
|
323
|
+
case @connection_options[:mode]
|
324
|
+
when :dblib
|
325
|
+
@connection.active?
|
326
|
+
end
|
331
327
|
raw_connection_do("SELECT 1")
|
332
328
|
true
|
333
329
|
rescue *lost_connection_exceptions
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-sqlserver-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 35
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 2.3.
|
9
|
+
- 16
|
10
|
+
version: 2.3.16
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ken Collins
|
@@ -19,7 +19,7 @@ autorequire:
|
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
21
|
|
22
|
-
date: 2011-
|
22
|
+
date: 2011-04-01 00:00:00 -04:00
|
23
23
|
default_executable:
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
115
|
requirements: []
|
116
116
|
|
117
117
|
rubyforge_project:
|
118
|
-
rubygems_version: 1.
|
118
|
+
rubygems_version: 1.6.2
|
119
119
|
signing_key:
|
120
120
|
specification_version: 3
|
121
121
|
summary: SQL Server 2000, 2005 and 2008 Adapter For Rails.
|