Skip to content
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

Implement v1 #32

Open
wants to merge 68 commits into
base: main
Choose a base branch
from
Open

Implement v1 #32

wants to merge 68 commits into from

Conversation

mirakui
Copy link
Collaborator

@mirakui mirakui commented Oct 13, 2024

  • Added support for ActiveRecord 7.1.
  • Redesigned the proxy chain to accommodate internal structure changes in ActiveRecord 7.1.
  • Introduced integration tests using real databases, allowing for more robust testing of functionality with MySQL, PostgreSQL, SQLite, and SQLServer.

@nekketsuuu nekketsuuu requested a review from a team October 13, 2024 09:03
Copy link
Contributor

@nekketsuuu nekketsuuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for writing these changes!

@@ -2,8 +2,8 @@ module Arproxy
class Base
attr_accessor :proxy_chain, :next_proxy

def execute(sql, name=nil, **kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q. This removal of kwargs may break some proxies which use keyword arguments.

Have you assumed any proxies, which inherits Arprxy::Base, should not accept keyword arguments?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nekketsuuu Good question.
Indeed, in the current Arproxy, Arproxy::Base#execute actually replaced the call to ConnectionAdapter’s #execute, so kwargs was necessary as an argument.
However, in Arproxy v1, a new class named Arproxy::ConnectionAdapterPatch takes on this role. Arproxy::Base#execute is called with two arguments of (sql, name) from the patch, so kwargs is no longer needed in this context.

https://github.com/cookpad/arproxy/pull/32/files#diff-b0f45f0d5c3f0e5178dce37a7f81a3b41699ebec5c4d0a2a3cff7d5a53b7dbcaR72

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this won't break ConnectionAdapter's execute, but I mean that this may break the behavior of execute of the existing proxies (classes that inherit Arproxy::Base). If these proxies use the given keyword arguments, all of them will be changed to nil in v1. I heard that you'd like to maintain backward compatibility for proxies (#30 ), so I wonder if this is your intention.

@@ -0,0 +1,46 @@
services:
mysql:
image: mysql:8.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO: MySQL 9.0 has been released on 2024-07-01. How about using the latest version of MySQL?

(Please note that the mysql_native_password plugin has been removed at MySQL 9.0. We would be able to choose not to set the password, though.)

docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
.github/workflows/integration_tests.yml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated
- SQLServer
- `activerecord-sqlserver-adapter`

We have tested with the following versions of Ruby and ActiveRecord:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: How about adding the versions of databases which we run the integration tests?

spec/arproxy_spec.rb Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Developing arproxy v1: integration tests, redesign aiming to fully support for AR7.1+
2 participants