Automatic connection switches between primary/replica db based on SQL

I saw in this PR Part 4: Multi db improvements, Basic API for connection switching by eileencodes · Pull Request #34052 · rails/rails · GitHub there was talk of adding a feature where ActiveRecord would automatically switch between primary/replica database based off the SQL query. I’m curious if that has been implemented yet as I haven’t seen anything saying so in the latest documentation. I see Rails can currently switch (if configured) to automatically switch based off of HTTP request only. I ask because I’m currently going through an application and wrapping queries such as User.where in " ``` ActiveRecord::Base.connected_to(role: :reading

1 Like