activerecord-sqlserver-adapter 4.2.18 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -223
- data/Gemfile +18 -17
- data/RAILS5-TODO.md +36 -0
- data/README.md +27 -8
- data/RUNNING_UNIT_TESTS.md +0 -17
- data/Rakefile +2 -7
- data/VERSION +1 -1
- data/activerecord-sqlserver-adapter.gemspec +1 -1
- data/appveyor.yml +0 -2
- data/lib/active_record/connection_adapters/sqlserver/core_ext/explain.rb +15 -8
- data/lib/active_record/connection_adapters/sqlserver/database_statements.rb +45 -97
- data/lib/active_record/connection_adapters/sqlserver/database_tasks.rb +1 -2
- data/lib/active_record/connection_adapters/sqlserver/quoting.rb +31 -10
- data/lib/active_record/connection_adapters/sqlserver/schema_creation.rb +0 -18
- data/lib/active_record/connection_adapters/sqlserver/schema_dumper.rb +16 -0
- data/lib/active_record/connection_adapters/sqlserver/schema_statements.rb +101 -58
- data/lib/active_record/connection_adapters/sqlserver/showplan.rb +7 -7
- data/lib/active_record/connection_adapters/sqlserver/sql_type_metadata.rb +20 -0
- data/lib/active_record/connection_adapters/sqlserver/table_definition.rb +56 -32
- data/lib/active_record/connection_adapters/sqlserver/transaction.rb +1 -1
- data/lib/active_record/connection_adapters/sqlserver/type.rb +34 -32
- data/lib/active_record/connection_adapters/sqlserver/type/big_integer.rb +4 -0
- data/lib/active_record/connection_adapters/sqlserver/type/binary.rb +6 -0
- data/lib/active_record/connection_adapters/sqlserver/type/boolean.rb +3 -0
- data/lib/active_record/connection_adapters/sqlserver/type/char.rb +9 -20
- data/lib/active_record/connection_adapters/sqlserver/type/data.rb +30 -0
- data/lib/active_record/connection_adapters/sqlserver/type/date.rb +28 -4
- data/lib/active_record/connection_adapters/sqlserver/type/datetime.rb +28 -14
- data/lib/active_record/connection_adapters/sqlserver/type/datetime2.rb +2 -2
- data/lib/active_record/connection_adapters/sqlserver/type/datetimeoffset.rb +4 -16
- data/lib/active_record/connection_adapters/sqlserver/type/decimal.rb +9 -0
- data/lib/active_record/connection_adapters/sqlserver/type/float.rb +4 -0
- data/lib/active_record/connection_adapters/sqlserver/type/integer.rb +3 -0
- data/lib/active_record/connection_adapters/sqlserver/type/money.rb +5 -1
- data/lib/active_record/connection_adapters/sqlserver/type/real.rb +4 -0
- data/lib/active_record/connection_adapters/sqlserver/type/small_integer.rb +3 -1
- data/lib/active_record/connection_adapters/sqlserver/type/small_money.rb +5 -1
- data/lib/active_record/connection_adapters/sqlserver/type/smalldatetime.rb +8 -1
- data/lib/active_record/connection_adapters/sqlserver/type/text.rb +4 -0
- data/lib/active_record/connection_adapters/sqlserver/type/time.rb +20 -8
- data/lib/active_record/connection_adapters/sqlserver/type/time_value_fractional.rb +25 -10
- data/lib/active_record/connection_adapters/sqlserver/type/timestamp.rb +4 -0
- data/lib/active_record/connection_adapters/sqlserver/type/tiny_integer.rb +3 -0
- data/lib/active_record/connection_adapters/sqlserver/type/unicode_char.rb +6 -0
- data/lib/active_record/connection_adapters/sqlserver/type/unicode_text.rb +4 -0
- data/lib/active_record/connection_adapters/sqlserver/type/unicode_varchar.rb +7 -1
- data/lib/active_record/connection_adapters/sqlserver/type/unicode_varchar_max.rb +5 -1
- data/lib/active_record/connection_adapters/sqlserver/type/uuid.rb +15 -2
- data/lib/active_record/connection_adapters/sqlserver/type/varbinary.rb +7 -1
- data/lib/active_record/connection_adapters/sqlserver/type/varbinary_max.rb +5 -1
- data/lib/active_record/connection_adapters/sqlserver/type/varchar.rb +7 -1
- data/lib/active_record/connection_adapters/sqlserver/type/varchar_max.rb +5 -1
- data/lib/active_record/connection_adapters/sqlserver/utils.rb +10 -0
- data/lib/active_record/connection_adapters/sqlserver_adapter.rb +71 -57
- data/lib/active_record/connection_adapters/sqlserver_column.rb +5 -30
- data/lib/active_record/sqlserver_base.rb +1 -5
- data/lib/arel/visitors/sqlserver.rb +11 -20
- data/test/bin/setup.sh +4 -6
- data/test/cases/adapter_test_sqlserver.rb +11 -20
- data/test/cases/coerced_tests.rb +233 -138
- data/test/cases/column_test_sqlserver.rb +244 -227
- data/test/cases/connection_test_sqlserver.rb +5 -76
- data/test/cases/fully_qualified_identifier_test_sqlserver.rb +7 -7
- data/test/cases/helper_sqlserver.rb +4 -15
- data/test/cases/pessimistic_locking_test_sqlserver.rb +1 -1
- data/test/cases/rake_test_sqlserver.rb +20 -14
- data/test/cases/schema_dumper_test_sqlserver.rb +94 -63
- data/test/cases/schema_test_sqlserver.rb +2 -2
- data/test/cases/showplan_test_sqlserver.rb +1 -1
- data/test/cases/specific_schema_test_sqlserver.rb +7 -14
- data/test/cases/transaction_test_sqlserver.rb +1 -1
- data/test/cases/uuid_test_sqlserver.rb +0 -1
- data/test/config.yml +0 -10
- data/test/migrations/transaction_table/1_table_will_never_be_created.rb +1 -1
- data/test/schema/sqlserver_specific_schema.rb +0 -16
- data/test/support/coerceable_test_sqlserver.rb +6 -2
- data/test/support/connection_reflection.rb +0 -4
- data/test/support/sql_counter_sqlserver.rb +17 -21
- metadata +9 -7
- data/lib/active_record/connection_adapters/sqlserver/core_ext/odbc.rb +0 -34
- data/lib/active_record/connection_adapters/sqlserver/schema_cache.rb +0 -114
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5143ee7d732b5af4ef584e9d462d1bce08ab112
|
4
|
+
data.tar.gz: f117c34a2a6ffaa6a156e3ce513e0767f2f53d21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ecdf97d6de086bbd9c2dbd0762f02c79bd190d788a947639db5cc24d10236a458936068a6259e0dcdf44f3f0924149b3472eb90e37745a1958e9c0d0ddc51b2
|
7
|
+
data.tar.gz: 25de68a67a59689818cdd60ba13ba36598fff1be2b06194c68d481335c9c26af13cd8a021e6e54df677cf9d02e8a363db4b8549af0dbbf54ba408093ef38fb2e
|
data/CHANGELOG.md
CHANGED
@@ -1,239 +1,24 @@
|
|
1
|
-
## v4.2.18
|
2
1
|
|
3
|
-
##
|
4
|
-
|
5
|
-
* Add `WITH NO_INFOMSGS` to `user_options` method. Fixes #580
|
6
|
-
|
7
|
-
#### Changed
|
8
|
-
|
9
|
-
* Pass the `:contained` option to TinyTDS. Fixes #527
|
10
|
-
|
11
|
-
|
12
|
-
## v4.2.17
|
13
|
-
|
14
|
-
#### Changed
|
15
|
-
|
16
|
-
* The `user_options` parsing. Works for hash/array. Fixes #535
|
17
|
-
|
18
|
-
|
19
|
-
## v4.2.16
|
20
|
-
|
21
|
-
#### Fixed
|
22
|
-
|
23
|
-
* Overwrite `_type_cast` method for char data. Fixes #491 #494
|
24
|
-
* Char type data compared against it's string value. Fixes #487 #488
|
25
|
-
* Filter table constraints with matching table schema to column. Fixes #478
|
26
|
-
|
27
|
-
|
28
|
-
## v4.2.15
|
29
|
-
|
30
|
-
#### Fixed
|
31
|
-
|
32
|
-
* Removed errand puts statment from database tasks.
|
33
|
-
* Fix quoting of non-national columns.
|
34
|
-
|
35
|
-
|
36
|
-
## v4.2.14
|
37
|
-
|
38
|
-
#### Fixed
|
39
|
-
|
40
|
-
* Fix rescue constants for optional connection gems. Fixes #475.
|
41
|
-
|
42
|
-
|
43
|
-
## v4.2.13
|
44
|
-
|
45
|
-
#### Fixed
|
46
|
-
|
47
|
-
* Add to_s method to SQLServer::Type::Char::Data. Thanks @marceloeloelo.
|
48
|
-
|
49
|
-
|
50
|
-
## v4.2.12
|
51
|
-
|
52
|
-
#### Fixed
|
53
|
-
|
54
|
-
* Isolation levels not being reset on error. Fixes #469. Thanks @anthony
|
55
|
-
|
56
|
-
|
57
|
-
## v4.2.11
|
58
|
-
|
59
|
-
#### Fixed
|
60
|
-
|
61
|
-
* Undefined method `database_prefix_remote_server?' Fixes #450. Thanks @jippeholwerda
|
62
|
-
* Document two methods for avoiding N'' quoting on char/varchar columns.
|
63
|
-
* First run failure of `change_column` while dropping constraint. Fixes #420. Thanks @GrumpyRainbow @rkr090
|
64
|
-
* Rounding errors w/datetime2(0) types having no fractional seconds. Fixes #465. Thanks @alawton
|
65
|
-
|
66
|
-
#### Changed
|
67
|
-
|
68
|
-
* Supporting escape hatch for N'' quoting. Remove `#is_utf8` string check in `#_quote` method.
|
69
|
-
This duplicated strings and forced encoding which was actually wasteful.
|
70
|
-
|
71
|
-
|
72
|
-
## v4.2.10
|
73
|
-
|
74
|
-
#### Fixed
|
75
|
-
|
76
|
-
* Ensure small datetime/datetime2 fractionals are properly quoted. Fixes #457.
|
77
|
-
|
78
|
-
|
79
|
-
## v4.2.9
|
80
|
-
|
81
|
-
#### Fixed
|
82
|
-
|
83
|
-
* Conform to new data_sources interfaces. See: https://git.io/va4Fp
|
84
|
-
* The `primary_key` method falls back to Identity columns. Not the other way around. Fixes #454. Thanks @marceloeloelo
|
85
|
-
* Ensure that `execute_procedure` returns proper time zones. Fixes #449
|
86
|
-
|
87
|
-
#### Changed
|
88
|
-
|
89
|
-
* Run tests with verbose false.
|
90
|
-
|
91
|
-
|
92
|
-
## v4.2.8
|
93
|
-
|
94
|
-
#### Fixed
|
95
|
-
|
96
|
-
* Azure-Friendly Disable Referential Integrity. No more `sp_MSforeachtable` usage. Fixes #421
|
97
|
-
* Azure-Friendly DB create/drop. Fixes #442
|
98
|
-
- Create allows edition options like: MAXSIZE, EDITION, and SERVICE_OBJECTIVE.
|
99
|
-
|
100
|
-
|
101
|
-
## v4.2.7
|
102
|
-
|
103
|
-
#### Added
|
104
|
-
|
105
|
-
* Support 2008 Datatypes Using TDSVER=7.3. Fixes #433
|
106
|
-
|
107
|
-
#### Changed
|
108
|
-
|
109
|
-
* Test now use latest v0.9.5 of TinyTDS. Includes tests for `defncopy` Windows binstub.
|
110
|
-
* Make linked servers stronger. Fixes #427. Thanks @jippeholwerda
|
111
|
-
* Use proper module for the `sqlserver_connection` method. Fixes #431. Thanks @jippeholwerda
|
112
|
-
* All datetime casting using the `Time::DATE_FORMATS[:_sqlserver_*]` formats set after connection.
|
113
|
-
|
114
|
-
#### Removed
|
115
|
-
|
116
|
-
* The `SQLServer::Utils.with_sqlserver_db_date_formats` helper and `quoted_date` hacks.
|
117
|
-
* The `Quoter` value type which allowed column => type special case quoting.
|
118
|
-
|
119
|
-
#### Fixed
|
120
|
-
|
121
|
-
* Every time datatype has perfect micro/nano second handling.
|
122
|
-
* All supported datatypes dump defaults properly to schema.rb
|
123
|
-
* Partial indexes using `:where` in schema dumper. Fixes #153
|
124
|
-
|
125
|
-
|
126
|
-
## v4.2.6
|
127
|
-
|
128
|
-
#### Fixed
|
129
|
-
|
130
|
-
* Allow linked servers for table names. Fixes #426. Thanks @jippeholwerda
|
131
|
-
|
132
|
-
|
133
|
-
## v4.2.5
|
134
|
-
|
135
|
-
#### Removed
|
136
|
-
|
137
|
-
* Remove Type::Castable hacks for core type objects to force trust the DB. Allows Rails 5 attributes.
|
138
|
-
|
139
|
-
#### Fixed
|
140
|
-
|
141
|
-
* Tests for decimal scale. See Rails commit. http://git.io/vGotB
|
142
|
-
* Improve case comparision performace per column. Fixes #414
|
143
|
-
* DB rollback when reversable add_column has several options. Fixes #359
|
144
|
-
* Better column definitions for default objects. Fixes #412
|
145
|
-
|
146
|
-
|
147
|
-
## v4.2.4
|
148
|
-
|
149
|
-
#### Fixed
|
150
|
-
|
151
|
-
* Compatible with Rails 4.2.1.
|
152
|
-
* Fix schema limit reflection for char/varchar. Fixes #394.
|
153
|
-
|
154
|
-
|
155
|
-
## v4.2.3
|
156
|
-
|
157
|
-
#### Fixed
|
158
|
-
|
159
|
-
* Fix SET defaults when using Azure.
|
160
|
-
* Test insert 4-byte unicode chars.
|
161
|
-
* Make rollback transaction transcount aware for implicit error rollbacks. Fixes #390
|
162
|
-
|
163
|
-
|
164
|
-
## v4.2.2
|
2
|
+
## v5.0.0
|
165
3
|
|
166
4
|
#### Added
|
167
5
|
|
168
|
-
*
|
169
|
-
*
|
170
|
-
|
171
|
-
|
172
|
-
## v4.2.1
|
173
|
-
|
174
|
-
#### Fixed
|
175
|
-
|
176
|
-
* Guard against empty view definitions when `sb_helptext` fails silently. Fixes #337.
|
177
|
-
* Proper table/column escaping in the `change_column_null` method. Fixes #355.
|
178
|
-
* Use `send :include` for modules for 1.9 compatibility. Fixes #383.
|
179
|
-
|
180
|
-
|
181
|
-
## v4.2.0
|
182
|
-
|
183
|
-
#### Added
|
184
|
-
|
185
|
-
* New `ActiveRecord::Type` objects. See `active_record/connection_adapters/sqlserver/type` dir.
|
186
|
-
* Aliased `ActiveRecord::Type::SQLServer` to `ActiveRecord::ConnectionAdapters::SQLServer::Type`
|
187
|
-
* New `SQLServer::Utils::Name` object for decomposing and quoting SQL Server names/identifiers.
|
188
|
-
* Support for most all SQL Server types in schema statements and dumping.
|
189
|
-
* Support create table with query from relation or select statement.
|
190
|
-
* Foreign Key Support Fixes #375.
|
6
|
+
* Support for `supports_datetime_with_precision`.
|
7
|
+
* Support for `unprepared_statement` blocks on the connection.
|
191
8
|
|
192
9
|
#### Changed
|
193
10
|
|
194
|
-
*
|
195
|
-
* Complete rewrite of our Arel visitor. Focuing on 2012 and upward so we can make FETCH happen.
|
196
|
-
* Testing enhancements.
|
197
|
-
* Guard support, check our Guardfile.
|
198
|
-
* Use `ARTest` namespace with `SQLServer` module for our helpers/objects.
|
199
|
-
* Simple 2012 schmea addition and extensive column/type_cast object tests.
|
200
|
-
* Follow Rails convention and remove varying character default limits.
|
201
|
-
* The `cs_equality_operator` is now s class configuration property only.
|
202
|
-
* The `with_identity_insert_enabled(table_name)` is now public.
|
203
|
-
* Use ActiveRecord tranasaction interface vs our own `run_with_isolation_level`.
|
11
|
+
* Major refactoring of all type objects. Especially time types.
|
204
12
|
|
205
13
|
#### Deprecated
|
206
14
|
|
207
|
-
*
|
15
|
+
* Support for a handful of standard Rails deprecations in 5-0-stable suite.
|
208
16
|
|
209
17
|
#### Removed
|
210
18
|
|
211
|
-
*
|
212
|
-
*
|
213
|
-
* Native type configs for older DB support. Includes the following with new default value:
|
214
|
-
* native_string_database_type => `nvarchar`
|
215
|
-
* native_text_database_type => `nvarchar(max)`
|
216
|
-
* native_binary_database_type => `varbinary(max)`
|
217
|
-
* Various version and inspection methods removed. These include:
|
218
|
-
* database_version
|
219
|
-
* database_year
|
220
|
-
* product_level
|
221
|
-
* product_version
|
222
|
-
* edition
|
223
|
-
* Removed tests for old issue #164. Handled by core types now.
|
224
|
-
* The `activity_stats` method. Please put this in a gem if needed.
|
225
|
-
* We no longer use regular expressions to fix identity inserts. Use ActiveRecord or public ID insert helper.
|
226
|
-
* All auto reconnect and SQL retry logic. Got too complicated and stood in the way of AR's pool. Speed boost too.
|
227
|
-
* The adapter will no longer try to remove duplicate order by clauses. Use relation `reorder`, `unscope`, etc.
|
228
|
-
* We no longer use regular expressions to remove identity columns from updates. Now with `attributes_for_update` AR hook.
|
19
|
+
* ODBC connection mode. Not been maintained since Rails 4.0.
|
20
|
+
* View table name detection in `with_identity_insert_enabled` method for fixtures. Perf hit.
|
229
21
|
|
230
22
|
#### Fixed
|
231
23
|
|
232
|
-
*
|
233
|
-
* Better bind types & params for `sp_executesql`. Fixes #239.
|
234
|
-
|
235
|
-
#### Security
|
236
|
-
|
237
|
-
* The connection's `inspect` method no longer returns sensitive connection info. Very basic now.
|
238
|
-
|
239
|
-
|
24
|
+
* Do not output column collation in schema when same as database.
|
data/Gemfile
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
gemspec
|
3
3
|
|
4
|
-
gem '
|
4
|
+
gem 'sqlite3'
|
5
|
+
gem 'minitest', '< 5.3.4'
|
6
|
+
gem 'bcrypt', platforms: [:mri]
|
5
7
|
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
6
8
|
|
7
9
|
if RbConfig::CONFIG["host_os"] =~ /darwin/
|
@@ -16,16 +18,20 @@ else
|
|
16
18
|
require 'net/http'
|
17
19
|
require 'yaml'
|
18
20
|
spec = eval(File.read('activerecord-sqlserver-adapter.gemspec'))
|
19
|
-
|
20
|
-
major, minor, tiny =
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
21
|
+
ver = spec.dependencies.detect{ |d|d.name == 'activerecord' }.requirement.requirements.first.last.version
|
22
|
+
major, minor, tiny, pre = ver.split('.')
|
23
|
+
if !pre
|
24
|
+
uri = URI.parse "https://rubygems.org/api/v1/versions/activerecord.yaml"
|
25
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
26
|
+
http.use_ssl = true
|
27
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
28
|
+
YAML.load(http.request(Net::HTTP::Get.new(uri.request_uri)).body).select do |data|
|
29
|
+
a, b, c = data['number'].split('.')
|
30
|
+
!data['prerelease'] && major == a && (minor.nil? || minor == b)
|
31
|
+
end.first['number']
|
32
|
+
else
|
33
|
+
ver
|
34
|
+
end
|
29
35
|
end
|
30
36
|
gem 'rails', git: "git://github.com/rails/rails.git", tag: "v#{version}"
|
31
37
|
end
|
@@ -44,15 +50,10 @@ group :tinytds do
|
|
44
50
|
end
|
45
51
|
end
|
46
52
|
|
47
|
-
group :odbc do
|
48
|
-
gem 'ruby-odbc'
|
49
|
-
end
|
50
|
-
|
51
53
|
group :development do
|
54
|
+
gem 'byebug'
|
52
55
|
gem 'mocha'
|
53
|
-
gem 'minitest', '< 5.3.4' # PENDING: [Rails5.x] Remove test order constraint.
|
54
56
|
gem 'minitest-spec-rails'
|
55
|
-
gem 'pry'
|
56
57
|
end
|
57
58
|
|
58
59
|
group :guard do
|
data/RAILS5-TODO.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
|
2
|
+
## SHORT TERM
|
3
|
+
|
4
|
+
Misc remidners while in the heat of adapting the adpater.
|
5
|
+
|
6
|
+
|
7
|
+
## LONG TERM
|
8
|
+
|
9
|
+
After we get some tests passing
|
10
|
+
|
11
|
+
* Check `sql_for_insert` can do without the table regular expresion.
|
12
|
+
* Do we need the `query_requires_identity_insert` check in `execute`?
|
13
|
+
* Does the schema cache serialize properly since we conform to that now?
|
14
|
+
* What does `supports_materialized_views?` means for SQL Server
|
15
|
+
- http://michaeljswart.com/2014/12/materialized-views-in-sql-server/
|
16
|
+
- https://blogs.msdn.microsoft.com/ssma/2011/06/20/migrating-oracle-materialized-view-to-sql-server/
|
17
|
+
- http://stackoverflow.com/questions/3986366/how-to-create-materialized-views-in-sql-server
|
18
|
+
* BIGINT PK support. https://github.com/rails/rails/pull/26266
|
19
|
+
* Can we use `OPTIMIZE FOR UNKNOWN`
|
20
|
+
- http://sqlblog.com/blogs/aaron_bertrand/archive/2011/09/17/bad-habits-to-kick-using-exec-instead-of-sp-executesql.aspx
|
21
|
+
- http://stackoverflow.com/questions/24016199/sql-server-stored-procedure-become-very-slow-raw-sql-query-is-still-very-fast
|
22
|
+
- https://blogs.msdn.microsoft.com/sqlprogrammability/2008/11/26/optimize-for-unknown-a-little-known-sql-server-2008-feature/
|
23
|
+
* Re-visit all `current_adapter?(:PostgreSQLAdapter)` checks and find ones we can play in.
|
24
|
+
|
25
|
+
|
26
|
+
#### Does Find By SQL Work?
|
27
|
+
|
28
|
+
With binds and prepareable?
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
# Post.find_by_sql ["SELECT title FROM posts WHERE author = ? AND created > ?", author_id, start_date]
|
32
|
+
# Post.find_by_sql ["SELECT body FROM comments WHERE author = :user_id OR approved_by = :user_id", { :user_id => user_id }]
|
33
|
+
#
|
34
|
+
def find_by_sql(sql, binds = [], preparable: nil)
|
35
|
+
result_set = connection.select_all(sanitize_sql(sql), "#{name} Load", binds, preparable: preparable)
|
36
|
+
```
|
data/README.md
CHANGED
@@ -1,13 +1,36 @@
|
|
1
1
|
|
2
2
|
# ActiveRecord SQL Server Adapter. For SQL Server 2012 And Higher.
|
3
3
|
|
4
|
-
* [![TravisCI](https://travis-ci.org/rails-sqlserver/activerecord-sqlserver-adapter.svg?branch=
|
5
|
-
* [![CircleCI](https://circleci.com/gh/rails-sqlserver/activerecord-sqlserver-adapter/tree/
|
6
|
-
* [![Build Status](https://ci.appveyor.com/api/projects/status/mtgbx8f57vr7k2qa/branch/
|
4
|
+
* [![TravisCI](https://travis-ci.org/rails-sqlserver/activerecord-sqlserver-adapter.svg?branch=master)](https://travis-ci.org/rails-sqlserver/activerecord-sqlserver-adapter) - TravisCI
|
5
|
+
* [![CircleCI](https://circleci.com/gh/rails-sqlserver/activerecord-sqlserver-adapter/tree/master.svg?style=svg)](https://circleci.com/gh/rails-sqlserver/activerecord-sqlserver-adapter/tree/master) - CircleCI
|
6
|
+
* [![Build Status](https://ci.appveyor.com/api/projects/status/mtgbx8f57vr7k2qa/branch/master?svg=true)](https://ci.appveyor.com/project/rails-sqlserver/activerecord-sqlserver-adapter/branch/master) - Appveyor
|
7
7
|
* [![Gem Version](http://img.shields.io/gem/v/activerecord-sqlserver-adapter.svg)](https://rubygems.org/gems/activerecord-sqlserver-adapter) - Gem Version
|
8
|
-
* [![Dependency Status](https://dependencyci.com/github/rails-sqlserver/activerecord-sqlserver-adapter/badge)](https://dependencyci.com/github/rails-sqlserver/activerecord-sqlserver-adapter) - Dependency Status
|
9
8
|
* [![Gitter chat](https://img.shields.io/badge/%E2%8A%AA%20GITTER%20-JOIN%20CHAT%20%E2%86%92-brightgreen.svg?style=flat)](https://gitter.im/rails-sqlserver/activerecord-sqlserver-adapter) - Community
|
10
9
|
|
10
|
+
## RAILS v5 COMING!!!
|
11
|
+
|
12
|
+
2017-01-04 - All core adapter tests are passing on Rails v5. We have ~60 failures under the full AcitveRecord suite. At this time, the foundation of the adapter is considered to be solid and the remaining tests will not likely require any refactors of the adapter internals.
|
13
|
+
|
14
|
+
This means you can technically bundle to the adapter's master branch and work with Rails 5. However, but reports should not be given till we have a release and pass all ActiveRecord tests. Please follow the `RAILS5-TODO.md` and `RAILS5-FAILS.txt` notes before filing issues.
|
15
|
+
|
16
|
+
* [RAILS5-TODO.md](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/master/RAILS5-TODO.md)
|
17
|
+
* [RAILS5-FAILS.txt](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/master/RAILS5-FAILS.txt)
|
18
|
+
* [All Rails 5.0 Issues - Closed](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/issues?q=label%3A%22Rails+5.0%22+is%3Aclosed)
|
19
|
+
* [All Rails 5.0 Issues - Open](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/labels/Rails%205.0)
|
20
|
+
|
21
|
+
* **Can I help?** - Thanks so much! Feel free to jump in. I suggest chatting on Gitter or GitHub to make sure we are not dupliating work.
|
22
|
+
* **What is the ETA of an initial release?** - My guess is that we can have an initial release by mid January easily.
|
23
|
+
|
24
|
+
|
25
|
+
#### Using Rails v4
|
26
|
+
|
27
|
+
Use these commands to use the latest of Rails v4 till our v5 release is ready.
|
28
|
+
|
29
|
+
```shell
|
30
|
+
$ gem install rails -v 4.2.7.1
|
31
|
+
$ rails _4.2.7.1_ new MYAPP --database=sqlserver
|
32
|
+
```
|
33
|
+
|
11
34
|
![kantishna-wide](https://cloud.githubusercontent.com/assets/2381/5895051/aa6a57e0-a4e1-11e4-95b9-23627af5876a.jpg)
|
12
35
|
|
13
36
|
## Code Name Kantishna
|
@@ -161,10 +184,6 @@ gem 'tiny_tds'
|
|
161
184
|
gem 'activerecord-sqlserver-adapter', '~> 4.2.0'
|
162
185
|
```
|
163
186
|
|
164
|
-
If you want to use ruby ODBC, please use the latest least. If you have any troubles installing the lower level libraries for the adapter, please consult the wiki pages for various platform installation guides. Tons of good info can be found and we ask that you contribute too!
|
165
|
-
|
166
|
-
http://wiki.github.com/rails-sqlserver/activerecord-sqlserver-adapter/platform-installation
|
167
|
-
|
168
187
|
|
169
188
|
## Contributing
|
170
189
|
|
data/RUNNING_UNIT_TESTS.md
CHANGED
@@ -28,8 +28,6 @@ $ bundle exec rake test TEST_FILES_AR="test/cases/finder_test.rb"
|
|
28
28
|
|
29
29
|
The default names for the test databases are `activerecord_unittest` and `activerecord_unittest2`. If you want to use another database name then be sure to update the connection file that matches your connection method in test/connections/native_sqlserver_#{connection_method}/connection.rb. Define a user named 'rails' in SQL Server with all privileges granted for the test databases. Use an empty password for said user.
|
30
30
|
|
31
|
-
The connection files make certain assumptions. For instance, the ODBC connection assumes you have a DSN setup that matches the name of the default database names. Remember too you have to set an environment variable for the DSN of the adapter, see the connection.rb file that matches your connection mode for details.
|
32
|
-
|
33
31
|
```sql
|
34
32
|
CREATE DATABASE [activerecord_unittest];
|
35
33
|
CREATE DATABASE [activerecord_unittest2];
|
@@ -93,18 +91,6 @@ $ bundle exec rake test
|
|
93
91
|
|
94
92
|
## Testing Options
|
95
93
|
|
96
|
-
The Gemfile contains groups for `:tinytds` and `:odbc`. By default it will install both gems which allows you to run the full test suite in either connection mode. If for some reason any one of these is problematic or of no concern, you could always opt out of bundling either gem with something like this.
|
97
|
-
|
98
|
-
```
|
99
|
-
$ bundle install --without odbc
|
100
|
-
```
|
101
|
-
|
102
|
-
You can run different connection modes using the following rake commands. Again, the DBLIB connection mode using TinyTDS is the default test task.
|
103
|
-
|
104
|
-
```
|
105
|
-
$ bundle exec rake test:dblib
|
106
|
-
$ bundle exec rake test:odbc
|
107
|
-
```
|
108
94
|
|
109
95
|
By default, Bundler will download the Rails git repo and use the git tag that matches the dependency version in our gemspec. If you want to test another version of Rails, you can either temporarily change the :tag for Rails in the Gemfile. Likewise, you can clone the Rails repo your self to another directory and use the `RAILS_SOURCE` environment variable.
|
110
96
|
|
@@ -116,6 +102,3 @@ By default, Bundler will download the Rails git repo and use the git tag that ma
|
|
116
102
|
* Possibly change the SQL Server TCP/IP properties in "SQL Server Configuration Manager -> SQL Server Network Configuration -> Protocols for MSSQLSERVER", and ensure that TCP/IP is enabled and the appropriate entries on the "IP Addresses" tab are enabled.
|
117
103
|
|
118
104
|
|
119
|
-
## Current Expected Failures
|
120
|
-
|
121
|
-
* Misc Date/Time erros when using ODBC mode.
|
data/Rakefile
CHANGED
@@ -8,7 +8,7 @@ task default: [:test]
|
|
8
8
|
|
9
9
|
namespace :test do
|
10
10
|
|
11
|
-
%w(dblib
|
11
|
+
%w(dblib).each do |mode|
|
12
12
|
|
13
13
|
Rake::TestTask.new(mode) do |t|
|
14
14
|
t.libs = ARTest::SQLServer.test_load_paths
|
@@ -23,17 +23,12 @@ namespace :test do
|
|
23
23
|
ENV['ARCONN'] = 'dblib'
|
24
24
|
end
|
25
25
|
|
26
|
-
task 'odbc:env' do
|
27
|
-
ENV['ARCONN'] = 'odbc'
|
28
|
-
end
|
29
|
-
|
30
26
|
end
|
31
27
|
|
32
28
|
task 'test:dblib' => 'test:dblib:env'
|
33
|
-
task 'test:odbc' => 'test:odbc:env'
|
34
29
|
|
35
30
|
namespace :profile do
|
36
|
-
['dblib'
|
31
|
+
['dblib'].each do |mode|
|
37
32
|
namespace mode.to_sym do
|
38
33
|
Dir.glob('test/profile/*_profile_case.rb').sort.each do |test_file|
|
39
34
|
profile_case = File.basename(test_file).sub('_profile_case.rb', '')
|