If you are using Rails muti-database feature, it's quite useful to know if you are connecting to the main writer database or a read replica before performing a database query in the Rails console.
The easiest way to do this is to call ActiveRecord::Base.connection_db_config
from the console:
> ActiveRecord::Base.connection_db_config
=>
#<ActiveRecord::DatabaseConfigurations::UrlConfig:0x123456…