-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for SQL Server on Rails 5.x, 6.x, and 7.x #1007
base: 50-stable
Are you sure you want to change the base?
Conversation
- execute and exec_query seem to work
- but the sql server arel visitor doe not work
- just copied type_to_sql method directly from pre-rails5 mssql adapter
handle migrations that specify a limit on integer columns
- pulled in exec_proc method from pre Rails 5 adapter - patch will now pass test exec_proc_test
- fixes some initial errors when dumping schema
- sqlserver 2000 is not supported anymore
included minimal to get identity_insert test passing. included minimal code from previous MSSQL::Column kept previous MSSQL::Column as old_column.rb
50 stable dev
Not sure we need this test or not.
50 stable dev
… as per jdbc specs for the postgresql jdbc This avoid issues when rails apps define date formats such as: Date::DATE_FORMATS.merge!(default: '%d/%m/%Y') This issue was suppose to be fixed by the previous commit but the method is overridden.
- supports_ddl_transactions? - supports_index_sort_order? - supports_partial_index? support for index sort order and partial index is partially supported, the adapter is able to create these indexes but it cannot retrieve for the schema, this is limitation of the jdbc driver, for future releases it would be better to get orders and where by using sp_helpindex or raw SQL.
…in configure connection)
just in case
… and 6.0 the error is: ActiveRecord::StatementInvalid: ActiveRecord::JDBCError: com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed. arjdbc/jdbc/RubyJdbcConnection.java:1144:in `execute_prepared_query'
Just for reference if there is anyone still interested on an Active Record SQL Server adapter the works with JRuby There is a fork of the https://rubygems.org/gems/activerecord-jdbc-alt-adapter It is strongly advised to read the README file of the forked repository for more information and differences compared to platforms :jruby do
gem 'activerecord-jdbc-alt-adapter', '~> 61.0.0'
gem 'jdbc-mssql', '~> 0.9.0'
end Some of our apps are already running in production and one of them is a huge ancient finance Rails app originally created with Rails 2.0 and JRuby. |
Support for Rails 7.1 and 7.2 might have bugs |
From what I remember @rdubya forked and updated our own codebase to make: https://github.com/jruby/activerecord-jdbcsqlserver-adapter . This was very similar in spirit to how the other adapters are in mainline arjdbc and I think @JesseChavez has his own version. I honestly do not remember the differences between the two but I know there was a discussion about the approaches at one point. |
@JesseChavez I am happy to merge this so long as you are happy to keep updating it or at least advising on reported issues. |
Hi All,
I have done some work to support the SQL Server / Azure SQL, it is mostly based on the sqlserver arel
visitor from the CRuby activerecord-sqlserver-adapter gem.
At the moment passes most of its tests and activerecord tests with few exceptions, the failing test are due
SQL server specific ways to do things such as:
gets ignored by Postgres.
NOTES:
To avoid the locking in read_committed we need to do:
The activerecord tests run against my rails fork which contains specific fixes to run the test such as decimal max precision 38, quoting for SQL Server, etc. Please look at my commit in the rails fork.
https://github.com/JesseChavez/rails/tree/5-0-stable-dev