Skip to content

Commit f385fcc

Browse files
committed
Merge branch '51-stable' into 52-stable
* 51-stable: [refactor] we could do a faster-path Date.new [refactor] move Date.new helper to utils mention and link SQLServer adapter fork [postgres] allow legacy binds [postgres] sync extract_value_from_default with AR Added a bit to the readme about mssql support Remove MSSQL support from rake tasks Fix more tests for supporting mssql Remove the mssql files (other than Java source related) and revert the mssql gemspec back to its original form Getting more of my changes in for activerecord-sqlserver-adapter gem support Rearranged the code so that we reuse the SQLServerAdapter class so more of the activerecord-sqlserver-adapter gem's methods will work Initial overrides to work with the activerecord-sqlserver-adapter gem to support MSSQL on Rails 5.0 Removed some rails version variables that are no longer needed
2 parents a376bfb + 4a79ed3 commit f385fcc

File tree

22 files changed

+305
-1972
lines changed

22 files changed

+305
-1972
lines changed

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
ActiveRecord-JDBC-Adapter (AR-JDBC) is the main database adapter for Rails'
66
*ActiveRecord* component that can be used with [JRuby][0].
77
ActiveRecord-JDBC-Adapter provides full or nearly full support for:
8-
**MySQL**, **PostgreSQL**, **SQLite3**. In the near future there are plans to
9-
add support **MSSQL**. Unless we get more contributions we will not be going
10-
beyond these four adapters. Note that the amount of work needed to get
11-
another adapter is not huge but the amount of testing required to make sure
12-
that adapter continues to work is not something we can do with the resources
13-
we currently have.
8+
**MySQL**, **PostgreSQL**, **SQLite3** and **MSSQL*** (SQLServer).
149

15-
For Oracle database users you are encouraged to use
16-
https://github.com/rsim/oracle-enhanced.
10+
Unless we get more contributions we will not be supporting more adapters.
11+
Note that the amount of work needed to get another adapter is not huge but
12+
the amount of testing required to make sure that adapter continues to work
13+
is not something we can do with the resources we currently have.
14+
15+
- for **Oracle** database users you are encouraged to use
16+
https://github.com/rsim/oracle-enhanced
17+
- **MSSQL** adapter's gem parts reside in a [separate repository][8]
1718

1819
Versions are targeted at certain versions of Rails and live on their own branches.
1920

@@ -39,6 +40,7 @@ adapters are available:
3940
- MySQL (`activerecord-jdbcmysql-adapter`)
4041
- PostgreSQL (`activerecord-jdbcpostgresql-adapter`)
4142
- SQLite3 (`activerecord-jdbcsqlite3-adapter`)
43+
- MSSQL (`activerecord-jdbcsqlserver-adapter`)
4244

4345
2. If you're generating a new Rails application, use the following command:
4446

@@ -173,4 +175,4 @@ license the database's drivers are licensed. See each driver gem's LICENSE.txt.
173175
[5]: https://github.com/jruby/activerecord-jdbc-adapter/wiki
174176
[6]: https://webchat.freenode.net/?channels=#jruby
175177
[7]: http://badge.fury.io/rb/activerecord-jdbc-adapter
176-
[8]: https://github.com/jruby/activerecord-jdbc-adapter/wiki/Migrating-from-1.2.x-to-1.3.0
178+
[8]: https://github.com/jruby/activerecord-jdbcsqlserver-adapter

lib/active_record/connection_adapters/mssql_adapter.rb

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/active_record/connection_adapters/sqlserver_adapter.rb

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/arjdbc/abstract/core.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def translate_exception(e, message)
5656
case e
5757
when SystemExit, SignalException, NoMemoryError then e
5858
when ActiveModel::RangeError, TypeError, RuntimeError then e
59-
else ActiveRecord::StatementInvalid.new(message)
59+
else super
6060
end
6161
end
6262

lib/arjdbc/jdbc.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22

33
module ArJdbc
44

5-
# @private
6-
AR40 = ::ActiveRecord::VERSION::MAJOR > 3
75
# @private
86
AR42 = ::ActiveRecord::VERSION::STRING >= '4.2'
9-
# @private
10-
AR50 = ::ActiveRecord::VERSION::MAJOR > 4
117

128
# @private
139
AR52 = ::ActiveRecord::VERSION::STRING >= '5.2'

lib/arjdbc/jdbc/column.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,13 @@ def initialize(config, name, *args)
2828

2929
if ArJdbc::AR52
3030
# undefined method `cast' for #<ActiveRecord::ConnectionAdapters::SqlTypeMetadata> on AR52
31-
elsif ArJdbc::AR50
31+
else
3232
default = args[0].cast(default)
3333

3434
sql_type = args.delete_at(1)
3535
type = args.delete_at(0)
3636

3737
args.unshift(SqlTypeMetadata.new(:sql_type => sql_type, :type => type))
38-
elsif ArJdbc::AR42
39-
default = args[0].type_cast_from_database(default)
40-
else
41-
default = default_value(default)
4238
end
4339

4440
# super <= 4.1: (name, default, sql_type = nil, null = true)

lib/arjdbc/mssql.rb

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)