-
Notifications
You must be signed in to change notification settings - Fork 48
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
Not ready to work with multiple databases #48
Comments
Adding a permalink copy, since the line has changed: Line 109 in 5d1fbc1
It looks like this code is only using it to determine if it's mysql or postgresql. We do use prosopite with multiple database, but they are all the same kind (mysql). |
It looks like we use ActiveSupport::Notification to subscribe to Lines 215 to 218 in 5d1fbc1
Pulling up the docs, it looks like one of the pieces of data that comes across is the |
test_prof uses e.g. to get a list of all my connection classes I can ActiveRecord::Base.connection_handler.connection_pool_list.map(&:connection_class).map(&:name).sort |
Is there any workaround for using prosopite with multiple databases that aren't all the same? We use both mysql and postgres and were hoping to start using prosopite. |
As I can see in source prosopite uses
ActiveRecord::Base
to define database adapter. If you have multiple databases you probably have multiple successors ofApplicationRecord
where each of them uses different database. When prosopite usesActiveRecord::Base
it will always get adapter of primary database which is not correct. As a result, gem just fails when encounters active record queries from not primary database and can't be used at all.Not sure if it's easy fix, but maybe it is worth mentioning it in docs?
The text was updated successfully, but these errors were encountered: