If you use MySql (Or MariaDB / etc) then would you be open to trying out the very reliable Trilogy driver? This is a fault-tolerant and highly performant alternative to the mysql2 driver, created by the loving folks at Github. An ActiveRecord adapter for it will ship with Rails 7.1, and as well it’s now available for use in Rails 7.0 via a recently-released update to the trilogy adapter gem. To use this in any Rails 7.0 project which targets MySql, put this in your Gemfile:
gem 'trilogy'
gem 'activerecord-trilogy-adapter'
And in your database.yml, change “mysql2” to “trilogy”, do a bundle, and *bam* it should work!