activerecord-sqlserver-adapter 3.1.0.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +8 -0
- data/README.rdoc +2 -0
- data/lib/active_record/connection_adapters/sqlserver/quoting.rb +7 -2
- data/lib/active_record/connection_adapters/sqlserver/version.rb +11 -0
- data/lib/active_record/connection_adapters/sqlserver_adapter.rb +2 -1
- data/lib/arel/visitors/sqlserver.rb +1 -11
- metadata +5 -5
data/CHANGELOG
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
|
2
|
+
* 3.1.1 *
|
3
|
+
|
4
|
+
* Provide a method to override for the quoted string prefix. Not a config because trumping this method will
|
5
|
+
have drastically bad results. Fixes #124
|
6
|
+
|
7
|
+
* Allow :limit/:offset to be used with fully qualified table and column in :select.
|
8
|
+
|
9
|
+
|
2
10
|
* 3.1.0 *
|
3
11
|
|
4
12
|
* Add support/test around handling of float/real column types [Lucas Maxwell]
|
data/README.rdoc
CHANGED
@@ -7,6 +7,8 @@ The SQL Server adapter for ActiveRecord. If you need the adapter for SQL Server
|
|
7
7
|
== What's New
|
8
8
|
|
9
9
|
* Rails 3.1 prepared statement support leverages cached query plans.
|
10
|
+
If you use DBLIB/TinyTDS, you must use FreeTDS 0.91 !!!!!
|
11
|
+
https://github.com/rails-sqlserver/tiny_tds/issues/41
|
10
12
|
* We now support your native language date/time formats automatically!
|
11
13
|
* Default unicode datatypes! Disable with #enable_default_unicode_types to false.
|
12
14
|
* New #lowercase_schema_reflection configuration option for legacy DBs.
|
@@ -4,6 +4,7 @@ module ActiveRecord
|
|
4
4
|
module Quoting
|
5
5
|
|
6
6
|
QUOTED_TRUE, QUOTED_FALSE = '1', '0'
|
7
|
+
QUOTED_STRING_PREFIX = 'N'
|
7
8
|
|
8
9
|
def quote(value, column = nil)
|
9
10
|
case value
|
@@ -13,7 +14,7 @@ module ActiveRecord
|
|
13
14
|
elsif column && column.type == :binary
|
14
15
|
column.class.string_to_binary(value)
|
15
16
|
elsif value.is_utf8? || (column && column.type == :string)
|
16
|
-
"
|
17
|
+
"#{quoted_string_prefix}'#{quote_string(value)}'"
|
17
18
|
else
|
18
19
|
super
|
19
20
|
end
|
@@ -31,7 +32,11 @@ module ActiveRecord
|
|
31
32
|
super
|
32
33
|
end
|
33
34
|
end
|
34
|
-
|
35
|
+
|
36
|
+
def quoted_string_prefix
|
37
|
+
QUOTED_STRING_PREFIX
|
38
|
+
end
|
39
|
+
|
35
40
|
def quote_string(string)
|
36
41
|
string.to_s.gsub(/\'/, "''")
|
37
42
|
end
|
@@ -7,6 +7,7 @@ require 'active_record/connection_adapters/sqlserver/database_statements'
|
|
7
7
|
require 'active_record/connection_adapters/sqlserver/errors'
|
8
8
|
require 'active_record/connection_adapters/sqlserver/schema_statements'
|
9
9
|
require 'active_record/connection_adapters/sqlserver/quoting'
|
10
|
+
require 'active_record/connection_adapters/sqlserver/version'
|
10
11
|
require 'active_support/core_ext/kernel/requires'
|
11
12
|
require 'active_support/core_ext/string'
|
12
13
|
require 'base64'
|
@@ -165,9 +166,9 @@ module ActiveRecord
|
|
165
166
|
include Sqlserver::SchemaStatements
|
166
167
|
include Sqlserver::DatabaseLimits
|
167
168
|
include Sqlserver::Errors
|
169
|
+
include Sqlserver::Version
|
168
170
|
|
169
171
|
ADAPTER_NAME = 'SQLServer'.freeze
|
170
|
-
VERSION = '3.1.0'.freeze
|
171
172
|
DATABASE_VERSION_REGEXP = /Microsoft SQL Server\s+"?(\d{4}|\w+)"?/
|
172
173
|
SUPPORTED_VERSIONS = [2005,2008,2010,2011].freeze
|
173
174
|
|
@@ -329,20 +329,10 @@ module Arel
|
|
329
329
|
core.projections.map do |x|
|
330
330
|
Arel.sql visit(x).split(',').map{ |y| y.split(' AS ').last.strip }.join(', ')
|
331
331
|
end
|
332
|
-
elsif function_select_statement?(o)
|
333
|
-
[Arel.star]
|
334
332
|
elsif select_primary_key_sql?(o)
|
335
333
|
[Arel.sql("[__rnt].#{quote_column_name(core.projections.first.name)}")]
|
336
334
|
else
|
337
|
-
|
338
|
-
if x.respond_to?(:relation)
|
339
|
-
x = x.dup
|
340
|
-
x.relation = x.relation.dup
|
341
|
-
x.relation.instance_variable_set :@table_alias, Arel.sql('[__rnt].*')
|
342
|
-
else
|
343
|
-
x
|
344
|
-
end
|
345
|
-
end
|
335
|
+
[Arel.sql('[__rnt].*')]
|
346
336
|
end
|
347
337
|
end
|
348
338
|
|
metadata
CHANGED
@@ -1,14 +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: 1
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
|
11
|
-
version: 3.1.0.0
|
9
|
+
- 1
|
10
|
+
version: 3.1.1
|
12
11
|
platform: ruby
|
13
12
|
authors:
|
14
13
|
- Ken Collins
|
@@ -20,7 +19,7 @@ autorequire:
|
|
20
19
|
bindir: bin
|
21
20
|
cert_chain: []
|
22
21
|
|
23
|
-
date: 2011-
|
22
|
+
date: 2011-09-22 00:00:00 -04:00
|
24
23
|
default_executable:
|
25
24
|
dependencies:
|
26
25
|
- !ruby/object:Gem::Dependency
|
@@ -58,6 +57,7 @@ files:
|
|
58
57
|
- lib/active_record/connection_adapters/sqlserver/errors.rb
|
59
58
|
- lib/active_record/connection_adapters/sqlserver/quoting.rb
|
60
59
|
- lib/active_record/connection_adapters/sqlserver/schema_statements.rb
|
60
|
+
- lib/active_record/connection_adapters/sqlserver/version.rb
|
61
61
|
- lib/active_record/connection_adapters/sqlserver_adapter.rb
|
62
62
|
- lib/activerecord-sqlserver-adapter.rb
|
63
63
|
- lib/arel/visitors/sqlserver.rb
|