class ActiveRecord::ConnectionAdapters::ConnectionHandler

def remove_connection_pool(owner, role: ActiveRecord::Base.current_role, shard: ActiveRecord::Base.current_shard)

def remove_connection_pool(owner, role: ActiveRecord::Base.current_role, shard: ActiveRecord::Base.current_shard)
  if pool_manager = get_pool_manager(owner)
    pool_config = pool_manager.remove_pool_config(role, shard)
    if pool_config
      pool_config.disconnect!
      pool_config.db_config
    end
  end
end