All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and as of v1.0.0 this project adheres to Semantic Versioning.
- Remove dependency on
mutex_m
, instead usingThread::Mutex
directly.
- Moved
select_db
inside of thewith_raw_connection
block of the#raw_execute
method. This should allow for using Rails' built-in reconnect & retry logic with the Trilogy adapter or Rails 7.1+. - In Rails 7.1+, when a new ConnectionProxy is instantiated the database switch is lazily triggered by the subsequent database query instead of immediately.
- Calling
#clean!
and#verified!
on connections because it is no longer necessary.
- Calls
#verified!
on the connection after#clean!
.
- A typo causing
#clean!
to not run.
- Calls
#clean!
on the connection after switching databases.
- Support and testing for Rails 7.2 & Rails main.
- Support for ActiveRecord's legacy connection handling.
- Support for Ruby 3.0.
- Rails 6.1 testing with Trilogy.
- Fixed using ActiveRecordHostPool and the
activerecord-trilogy-adapter v3.1+
.
- ActiveRecordHostPool will now raise an exception if you try to use a version of
activerecord-trilogy-adapter < 3.1
.
- ActiveRecordHostPool now uses prepend to patch
#execute
,#raw_execute
,#drop_database
,#create_database
, and#disconnect!
. Prepending is incompatible when also usingalias
oralias_method
to patch those methods; avoid aliasing them to prevent an infinite loop.
- Dropped support for Ruby 2.7.x.
- Add support for Rails 7.1.
Trilogy
is now a supported MySQL database adapter. ActiveRecordHostPool no longer requiresmysql2
, nor does it explicitly requireactiverecord-trilogy-adapter
. Applications using ARHP will now need to explicitly require one of these adapters in its gemfile. When usingactiverecord-trilogy-adapter
also ensure that thetrilogy
gem is locked tov2.5.0+
.
- Remove
mysql2
as a direct dependency, test Rails 7.0 withmysql2
andactiverecord-trilogy-adapter
. - Remove support for Rails 5.1, 5.2, and 6.0.
- Implement equality for connection proxies to consider database; allows fixture loading for different databases
- Start testing with Ruby 3.2.
- Drop Ruby 2.6.
- Use a mutex inside
PoolProxy#disconnect!
. This might fix someActiveRecord::ConnectionNotEstablished
issues when a multi-threaded application is under heavy load. (Only applies when using Rails 6.1 or newer).
- Fixed the warning when using
ruby2_keywords
onexecute_with_switching
. - Simplified the
clear_query_caches_for_current_thread
patch.
- Fix the patch for
ActiveRecord::Base.clear_query_caches_for_current_thread
to work correctly right after the creation of a new connection pool. (#105)
- Add a new
ActiveRecordHostPool::PoolProxy#_unproxied_connection
method which gives access to the underlying, "real", shared connection without going through the connection proxy, which would call#_host_pool_current_database=
on the underlying connection. (#104)
- Fix the patch for
ActiveRecord::Base.clear_on_handler
to work correctly right after the creation of a new connection pool. (#104)
- Fix forwarding of kwargs when calling
#execute
in Rails 7. (#101)
- Support for Rails 7.0 with legacy_connection_handling=false and legacy_connection_handling=true
- Start testing with Ruby 3.0 & 3.1
- Ensure that recently added files "lib/active_record_host_pool/pool_proxy_6_1.rb" and "lib/active_record_host_pool/pool_proxy_legacy.rb" are built into the shipped gem. (#92)
- Support for Rails 6.1 with legacy_connection_handling=false and legacy_connection_handling=true
- Add missing file to the released gem. (#68)
- Fix unintended connection switching while clearing query cache in Rails 6.0. (#61)
- Fix connection leakage when calling
release_connection
on pre-Rails 5 applications. (#58)
- Support for Rails 6.0.x. (#53)
- This gem now adheres to semantic versioning.
- Support for Rails 5.2.3. (#48)
- Removed testing with EOL Ruby 2.3 (#49)
- Start testing with Ruby 2.5
- Update Gem ownership (#38)
- Removed compatibility with Rails 3.2 and lower.
- Removed compatibility with Rails 5.0.
- Stop testing with Ruby 2.2.
- Removed support for the mysql gem, and only support mysql2 (#35)
Unwritten