Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question - Is it possible to switch connection to a database which doesn't exists in database.yml ? #182

Open
vaibhavpaliwal opened this issue Jun 8, 2018 · 0 comments

Comments

@vaibhavpaliwal
Copy link

We have been using this gem in production for some time now without any issues. However, every time we add a new shard in database.yml we have to redeploy our service. I was curious if its possible to switch connection to a database which doesn't exists in database.yml by directly passing in the database name something like below?

ActiveRecord::Base.on_shard(database_name)

I have seen other solutions online which suggests to use establish_connection in application_controller before_action but before implementing that I would like to know if this gem already supports this functionality or if it could be extended to support it. I am willing to contribute PR if someone can provide little guidance in the right direction.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant