activerecord-sqlserver-adapter 5.2.1 → 6.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.editorconfig +9 -0
- data/.github/issue_template.md +23 -0
- data/.travis.yml +6 -8
- data/CHANGELOG.md +22 -32
- data/{Dockerfile → Dockerfile.ci} +1 -1
- data/Gemfile +42 -41
- data/README.md +9 -30
- data/RUNNING_UNIT_TESTS.md +3 -0
- data/Rakefile +2 -0
- data/VERSION +1 -1
- data/activerecord-sqlserver-adapter.gemspec +25 -14
- data/appveyor.yml +24 -17
- data/docker-compose.ci.yml +7 -5
- data/guides/RELEASING.md +11 -0
- data/lib/active_record/connection_adapters/sqlserver/core_ext/active_record.rb +2 -0
- data/lib/active_record/connection_adapters/sqlserver/core_ext/attribute_methods.rb +2 -0
- data/lib/active_record/connection_adapters/sqlserver/core_ext/calculations.rb +2 -0
- data/lib/active_record/connection_adapters/sqlserver/core_ext/explain.rb +3 -1
- data/lib/active_record/connection_adapters/sqlserver/core_ext/explain_subscriber.rb +2 -0
- data/lib/active_record/connection_adapters/sqlserver/core_ext/finder_methods.rb +6 -4
- data/lib/active_record/connection_adapters/sqlserver/core_ext/preloader.rb +36 -0
- data/lib/active_record/connection_adapters/sqlserver/core_ext/query_methods.rb +4 -1
- data/lib/active_record/connection_adapters/sqlserver/database_limits.rb +9 -0
- data/lib/active_record/connection_adapters/sqlserver/database_statements.rb +55 -14
- data/lib/active_record/connection_adapters/sqlserver/database_tasks.rb +2 -0
- data/lib/active_record/connection_adapters/sqlserver/errors.rb +2 -0
- data/lib/active_record/connection_adapters/sqlserver/quoting.rb +38 -0
- data/lib/active_record/connection_adapters/sqlserver/schema_creation.rb +16 -3
- data/lib/active_record/connection_adapters/sqlserver/schema_dumper.rb +2 -0
- data/lib/active_record/connection_adapters/sqlserver/schema_statements.rb +93 -70
- data/lib/active_record/connection_adapters/sqlserver/showplan.rb +2 -0
- data/lib/active_record/connection_adapters/sqlserver/showplan/printer_table.rb +2 -0
- data/lib/active_record/connection_adapters/sqlserver/showplan/printer_xml.rb +2 -0
- data/lib/active_record/connection_adapters/sqlserver/sql_type_metadata.rb +2 -0
- data/lib/active_record/connection_adapters/sqlserver/table_definition.rb +42 -40
- data/lib/active_record/connection_adapters/sqlserver/transaction.rb +3 -1
- data/lib/active_record/connection_adapters/sqlserver/type.rb +2 -0
- data/lib/active_record/connection_adapters/sqlserver/type/big_integer.rb +3 -1
- data/lib/active_record/connection_adapters/sqlserver/type/binary.rb +5 -2
- data/lib/active_record/connection_adapters/sqlserver/type/boolean.rb +3 -1
- data/lib/active_record/connection_adapters/sqlserver/type/char.rb +5 -2
- data/lib/active_record/connection_adapters/sqlserver/type/data.rb +2 -0
- data/lib/active_record/connection_adapters/sqlserver/type/date.rb +3 -1
- data/lib/active_record/connection_adapters/sqlserver/type/datetime.rb +7 -6
- data/lib/active_record/connection_adapters/sqlserver/type/datetime2.rb +2 -0
- data/lib/active_record/connection_adapters/sqlserver/type/datetimeoffset.rb +2 -0
- data/lib/active_record/connection_adapters/sqlserver/type/decimal.rb +5 -2
- data/lib/active_record/connection_adapters/sqlserver/type/float.rb +3 -1
- data/lib/active_record/connection_adapters/sqlserver/type/integer.rb +3 -1
- data/lib/active_record/connection_adapters/sqlserver/type/json.rb +2 -0
- data/lib/active_record/connection_adapters/sqlserver/type/money.rb +4 -2
- data/lib/active_record/connection_adapters/sqlserver/type/real.rb +3 -1
- data/lib/active_record/connection_adapters/sqlserver/type/small_integer.rb +3 -1
- data/lib/active_record/connection_adapters/sqlserver/type/small_money.rb +4 -2
- data/lib/active_record/connection_adapters/sqlserver/type/smalldatetime.rb +3 -1
- data/lib/active_record/connection_adapters/sqlserver/type/string.rb +2 -0
- data/lib/active_record/connection_adapters/sqlserver/type/text.rb +3 -1
- data/lib/active_record/connection_adapters/sqlserver/type/time.rb +5 -4
- data/lib/active_record/connection_adapters/sqlserver/type/time_value_fractional.rb +2 -0
- data/lib/active_record/connection_adapters/sqlserver/type/timestamp.rb +3 -1
- data/lib/active_record/connection_adapters/sqlserver/type/tiny_integer.rb +3 -1
- data/lib/active_record/connection_adapters/sqlserver/type/unicode_char.rb +5 -2
- data/lib/active_record/connection_adapters/sqlserver/type/unicode_string.rb +2 -0
- data/lib/active_record/connection_adapters/sqlserver/type/unicode_text.rb +3 -1
- data/lib/active_record/connection_adapters/sqlserver/type/unicode_varchar.rb +6 -3
- data/lib/active_record/connection_adapters/sqlserver/type/unicode_varchar_max.rb +4 -2
- data/lib/active_record/connection_adapters/sqlserver/type/uuid.rb +3 -1
- data/lib/active_record/connection_adapters/sqlserver/type/varbinary.rb +6 -3
- data/lib/active_record/connection_adapters/sqlserver/type/varbinary_max.rb +4 -2
- data/lib/active_record/connection_adapters/sqlserver/type/varchar.rb +6 -3
- data/lib/active_record/connection_adapters/sqlserver/type/varchar_max.rb +4 -2
- data/lib/active_record/connection_adapters/sqlserver/utils.rb +2 -0
- data/lib/active_record/connection_adapters/sqlserver/version.rb +2 -0
- data/lib/active_record/connection_adapters/sqlserver_adapter.rb +44 -10
- data/lib/active_record/connection_adapters/sqlserver_column.rb +9 -3
- data/lib/active_record/sqlserver_base.rb +8 -0
- data/lib/active_record/tasks/sqlserver_database_tasks.rb +2 -0
- data/lib/activerecord-sqlserver-adapter.rb +2 -0
- data/lib/arel/visitors/sqlserver.rb +40 -10
- data/lib/arel_sqlserver.rb +2 -0
- data/test/appveyor/dbsetup.ps1 +4 -4
- data/test/cases/adapter_test_sqlserver.rb +65 -1
- data/test/cases/change_column_null_test_sqlserver.rb +2 -0
- data/test/cases/coerced_tests.rb +644 -187
- data/test/cases/column_test_sqlserver.rb +2 -1
- data/test/cases/connection_test_sqlserver.rb +2 -0
- data/test/cases/execute_procedure_test_sqlserver.rb +2 -0
- data/test/cases/fetch_test_sqlserver.rb +2 -0
- data/test/cases/fully_qualified_identifier_test_sqlserver.rb +4 -2
- data/test/cases/helper_sqlserver.rb +2 -0
- data/test/cases/in_clause_test_sqlserver.rb +36 -0
- data/test/cases/index_test_sqlserver.rb +2 -0
- data/test/cases/json_test_sqlserver.rb +2 -0
- data/test/cases/migration_test_sqlserver.rb +4 -2
- data/test/cases/order_test_sqlserver.rb +2 -0
- data/test/cases/pessimistic_locking_test_sqlserver.rb +2 -0
- data/test/cases/rake_test_sqlserver.rb +2 -0
- data/test/cases/schema_dumper_test_sqlserver.rb +3 -1
- data/test/cases/schema_test_sqlserver.rb +2 -0
- data/test/cases/scratchpad_test_sqlserver.rb +2 -0
- data/test/cases/showplan_test_sqlserver.rb +4 -2
- data/test/cases/specific_schema_test_sqlserver.rb +2 -0
- data/test/cases/transaction_test_sqlserver.rb +2 -1
- data/test/cases/trigger_test_sqlserver.rb +2 -1
- data/test/cases/utils_test_sqlserver.rb +2 -0
- data/test/cases/uuid_test_sqlserver.rb +2 -1
- data/test/debug.rb +2 -0
- data/test/migrations/create_clients_and_change_column_null.rb +2 -0
- data/test/migrations/transaction_table/1_table_will_never_be_created.rb +2 -0
- data/test/models/sqlserver/booking.rb +2 -0
- data/test/models/sqlserver/customers_view.rb +2 -0
- data/test/models/sqlserver/datatype.rb +2 -0
- data/test/models/sqlserver/datatype_migration.rb +2 -0
- data/test/models/sqlserver/dollar_table_name.rb +2 -0
- data/test/models/sqlserver/edge_schema.rb +2 -0
- data/test/models/sqlserver/fk_has_fk.rb +2 -0
- data/test/models/sqlserver/fk_has_pk.rb +2 -0
- data/test/models/sqlserver/natural_pk_data.rb +2 -0
- data/test/models/sqlserver/natural_pk_int_data.rb +2 -0
- data/test/models/sqlserver/no_pk_data.rb +2 -0
- data/test/models/sqlserver/object_default.rb +2 -0
- data/test/models/sqlserver/quoted_table.rb +2 -0
- data/test/models/sqlserver/quoted_view_1.rb +2 -0
- data/test/models/sqlserver/quoted_view_2.rb +2 -0
- data/test/models/sqlserver/sst_memory.rb +2 -0
- data/test/models/sqlserver/string_default.rb +2 -0
- data/test/models/sqlserver/string_defaults_big_view.rb +2 -0
- data/test/models/sqlserver/string_defaults_view.rb +2 -0
- data/test/models/sqlserver/tinyint_pk.rb +2 -0
- data/test/models/sqlserver/trigger.rb +2 -0
- data/test/models/sqlserver/trigger_history.rb +2 -0
- data/test/models/sqlserver/upper.rb +2 -0
- data/test/models/sqlserver/uppered.rb +2 -0
- data/test/models/sqlserver/uuid.rb +2 -0
- data/test/schema/sqlserver_specific_schema.rb +2 -0
- data/test/support/coerceable_test_sqlserver.rb +14 -5
- data/test/support/connection_reflection.rb +2 -0
- data/test/support/core_ext/query_cache.rb +3 -0
- data/test/support/load_schema_sqlserver.rb +2 -0
- data/test/support/minitest_sqlserver.rb +2 -0
- data/test/support/paths_sqlserver.rb +2 -0
- data/test/support/rake_helpers.rb +1 -0
- data/test/support/sql_counter_sqlserver.rb +3 -0
- data/test/support/test_in_memory_oltp.rb +2 -0
- metadata +18 -9
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ARTest
|
2
4
|
module SQLServer
|
3
5
|
module CoerceableTest
|
@@ -19,21 +21,28 @@ module ARTest
|
|
19
21
|
end
|
20
22
|
|
21
23
|
def coerce_all_tests!
|
22
|
-
once = false
|
23
24
|
instance_methods(false).each do |method|
|
24
25
|
next unless method.to_s =~ /\Atest/
|
25
26
|
undef_method(method)
|
26
|
-
once = true
|
27
27
|
end
|
28
28
|
STDOUT.puts "🙉 🙈 🙊 Undefined all tests: #{self.name}"
|
29
29
|
end
|
30
30
|
|
31
31
|
private
|
32
32
|
|
33
|
-
def coerced_test_warning(
|
34
|
-
|
33
|
+
def coerced_test_warning(test_to_coerce)
|
34
|
+
if test_to_coerce.is_a?(Regexp)
|
35
|
+
method = instance_methods(false).select { |m| m =~ test_to_coerce }
|
36
|
+
else
|
37
|
+
method = test_to_coerce
|
38
|
+
end
|
39
|
+
|
35
40
|
Array(method).each do |m|
|
36
|
-
result =
|
41
|
+
result = if m && method_defined?(m)
|
42
|
+
alias_method("original_#{test_to_coerce.inspect.tr('/\:"', '')}", m)
|
43
|
+
undef_method(m)
|
44
|
+
end
|
45
|
+
|
37
46
|
if result.blank?
|
38
47
|
STDOUT.puts "🐳 Unfound coerced test: #{self.name}##{m}"
|
39
48
|
else
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'active_record/connection_adapters/sqlserver_adapter'
|
2
4
|
|
3
5
|
module SqlIgnoredCache
|
@@ -5,6 +7,7 @@ module SqlIgnoredCache
|
|
5
7
|
|
6
8
|
IGNORED_SQL = [
|
7
9
|
/INFORMATION_SCHEMA\.(TABLES|VIEWS|COLUMNS|KEY_COLUMN_USAGE)/im,
|
10
|
+
/sys.columns/i,
|
8
11
|
/SELECT @@version/,
|
9
12
|
/SELECT @@TRANCOUNT/,
|
10
13
|
/(BEGIN|COMMIT|ROLLBACK|SAVE) TRANSACTION/,
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ARTest
|
2
4
|
module SQLServer
|
3
5
|
|
@@ -14,6 +16,7 @@ module ARTest
|
|
14
16
|
|
15
17
|
ignored_sql = [
|
16
18
|
/INFORMATION_SCHEMA\.(TABLES|VIEWS|COLUMNS|KEY_COLUMN_USAGE)/im,
|
19
|
+
/sys.columns/i,
|
17
20
|
/SELECT @@version/,
|
18
21
|
/SELECT @@TRANCOUNT/,
|
19
22
|
/(BEGIN|COMMIT|ROLLBACK|SAVE) TRANSACTION/,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-sqlserver-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ken Collins
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date: 2020-
|
17
|
+
date: 2020-05-15 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: activerecord
|
@@ -22,14 +22,14 @@ dependencies:
|
|
22
22
|
requirements:
|
23
23
|
- - "~>"
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version:
|
25
|
+
version: 6.0.0
|
26
26
|
type: :runtime
|
27
27
|
prerelease: false
|
28
28
|
version_requirements: !ruby/object:Gem::Requirement
|
29
29
|
requirements:
|
30
30
|
- - "~>"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
32
|
+
version: 6.0.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: tiny_tds
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,11 +52,13 @@ executables: []
|
|
52
52
|
extensions: []
|
53
53
|
extra_rdoc_files: []
|
54
54
|
files:
|
55
|
+
- ".editorconfig"
|
56
|
+
- ".github/issue_template.md"
|
55
57
|
- ".gitignore"
|
56
58
|
- ".travis.yml"
|
57
59
|
- CHANGELOG.md
|
58
60
|
- CODE_OF_CONDUCT.md
|
59
|
-
- Dockerfile
|
61
|
+
- Dockerfile.ci
|
60
62
|
- Gemfile
|
61
63
|
- Guardfile
|
62
64
|
- MIT-LICENSE
|
@@ -67,12 +69,14 @@ files:
|
|
67
69
|
- activerecord-sqlserver-adapter.gemspec
|
68
70
|
- appveyor.yml
|
69
71
|
- docker-compose.ci.yml
|
72
|
+
- guides/RELEASING.md
|
70
73
|
- lib/active_record/connection_adapters/sqlserver/core_ext/active_record.rb
|
71
74
|
- lib/active_record/connection_adapters/sqlserver/core_ext/attribute_methods.rb
|
72
75
|
- lib/active_record/connection_adapters/sqlserver/core_ext/calculations.rb
|
73
76
|
- lib/active_record/connection_adapters/sqlserver/core_ext/explain.rb
|
74
77
|
- lib/active_record/connection_adapters/sqlserver/core_ext/explain_subscriber.rb
|
75
78
|
- lib/active_record/connection_adapters/sqlserver/core_ext/finder_methods.rb
|
79
|
+
- lib/active_record/connection_adapters/sqlserver/core_ext/preloader.rb
|
76
80
|
- lib/active_record/connection_adapters/sqlserver/core_ext/query_methods.rb
|
77
81
|
- lib/active_record/connection_adapters/sqlserver/database_limits.rb
|
78
82
|
- lib/active_record/connection_adapters/sqlserver/database_statements.rb
|
@@ -146,6 +150,7 @@ files:
|
|
146
150
|
- test/cases/fetch_test_sqlserver.rb
|
147
151
|
- test/cases/fully_qualified_identifier_test_sqlserver.rb
|
148
152
|
- test/cases/helper_sqlserver.rb
|
153
|
+
- test/cases/in_clause_test_sqlserver.rb
|
149
154
|
- test/cases/index_test_sqlserver.rb
|
150
155
|
- test/cases/json_test_sqlserver.rb
|
151
156
|
- test/cases/migration_test_sqlserver.rb
|
@@ -206,7 +211,10 @@ files:
|
|
206
211
|
homepage: http://github.com/rails-sqlserver/activerecord-sqlserver-adapter
|
207
212
|
licenses:
|
208
213
|
- MIT
|
209
|
-
metadata:
|
214
|
+
metadata:
|
215
|
+
bug_tracker_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/issues
|
216
|
+
changelog_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/v6.0.0.rc1/CHANGELOG.md
|
217
|
+
source_code_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/v6.0.0.rc1
|
210
218
|
post_install_message:
|
211
219
|
rdoc_options: []
|
212
220
|
require_paths:
|
@@ -215,12 +223,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
215
223
|
requirements:
|
216
224
|
- - ">="
|
217
225
|
- !ruby/object:Gem::Version
|
218
|
-
version:
|
226
|
+
version: 2.5.0
|
219
227
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
220
228
|
requirements:
|
221
|
-
- - "
|
229
|
+
- - ">"
|
222
230
|
- !ruby/object:Gem::Version
|
223
|
-
version:
|
231
|
+
version: 1.3.1
|
224
232
|
requirements: []
|
225
233
|
rubygems_version: 3.0.3
|
226
234
|
signing_key:
|
@@ -241,6 +249,7 @@ test_files:
|
|
241
249
|
- test/cases/fetch_test_sqlserver.rb
|
242
250
|
- test/cases/fully_qualified_identifier_test_sqlserver.rb
|
243
251
|
- test/cases/helper_sqlserver.rb
|
252
|
+
- test/cases/in_clause_test_sqlserver.rb
|
244
253
|
- test/cases/index_test_sqlserver.rb
|
245
254
|
- test/cases/json_test_sqlserver.rb
|
246
255
|
- test/cases/migration_test_sqlserver.rb
|