-
Notifications
You must be signed in to change notification settings - Fork 385
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
Initial work to support Active Record 7.1 (Rails 7.1.x) #1150
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- .jrubyrc, to enable some extra debugging - .solargraph.yml and .rubocop.yml, for lsp in my editor - pik.sh, to pick my version of jruby to run test
…is later. - it was disabled to so we can focus on fixing the AR integration first - cannot run tests, process crashes
- it was disabled to so we can focus on fixing the core part first - cannot run tests, process crashes
we needed to add new_client class method similar to active record CRuby adapters so we can easily mock the raw_connection.
<ActiveRecord::StatementInvalid> expected but was <ActiveRecord::JDBCError(<java.sql.SQLSyntaxErrorException: Table 'arjdbc_test.animals' doesn't exist>) arjdbc/jdbc/RubyJdbcConnection.java:775:in `execute'
Loading development environment (Rails 7.0.8.4) [1] pry(main)> t = Time.current => Thu, 25 Jul 2024 16:56:41.434382638 AEST +10:00 [2] pry(main)> [3] pry(main)> t.to_s(:db) DEPRECATION WARNING: TimeWithZone#to_s(:db) is deprecated. Please use TimeWithZone#to_fs(:db) instead. (called from require at bin/rails:4) => "2024-07-25 06:56:41"
https://github.com/rails/rails/blob/7-1-stable/activerecord/lib/active_record/connection_adapters/mysql2/database_statements.rb#L21 https://github.com/rails/rails/blob/7-1-stable/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb#L63 there is diference between mysql/sqllite and postgres internal_exec_query method arity however due default values is not a issue at least for AR 7.1 some error example: Error: test_schema_dump(PostgresSchemaDumpTest): ArgumentError: unknown keywords: :allow_retry, :materialize_transactions /home/jessec/bryk/vendor_gems/stable/activerecord-jdbc-adapter/lib/arjdbc/abstract/database_statements.rb:37:in `internal_exec_query' /home/jessec/.gem/jruby/3.1.4/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/postgresql/schema_statements.rb:549:in `foreign_keys'
error: <ActiveRecord::StatementInvalid> expected but was <ActiveRecord::JDBCError(<org.postgresql.util.PSQLException: ERROR: relation "animals" does not exist Position: 454>)
…ore creating a savepoint change relates to rails/rails@3f19431 materilaization is trigger by executing any query inside the transaction Cherry-picked from my fork
Hello @JesseChavez. This looks great. At one point sqlite3 was running on Rails AR tests but some change in AR itself broke that (just noting I was confused when this PR came in because I know it was running to completion -- not your problem though). You had to commented out things which should be deleted but it is not worth holding this up for that. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @headius
Here is some initial work to support active record 7.1.
.github/workflows/ruby.yml
I can still look at the failing tests and rails tests later the following weeks.