You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature Request: Support loading resources from replica database with Rails 6.1 multi-database feature
Background:
Rails 6.1 introduced native support for multiple databases, including primary and replica databases configuration. This feature allows read and write operations to be directed to different databases, making it easier to scale applications by distributing the load.
Request:
I would like to request a feature in CanCanCan to support loading resources from the replica database. Currently, while it is possible to load resources using the load_and_authorize_resource method, there is no straightforward way to direct these read operations to a replica database.
Use Case:
Using the replica database for read-heavy operations such as listing resources or fetching details of a particular resource can enhance performance and reliability. To integrate CanCanCan with the new multi-database feature of Rails 6.1, it would be highly beneficial if the gem provided native support or a configuration mechanism to specify the database from which to load resources.
Suggested Implementation:
Allow an option or flag within the load_and_authorize_resource method to specify which database to use.
Integrate with Rails' connected_to framework to seamlessly switch the connection for specific actions.
Feature Request: Support loading resources from replica database with Rails 6.1 multi-database feature
Background:
Rails 6.1 introduced native support for multiple databases, including primary and replica databases configuration. This feature allows read and write operations to be directed to different databases, making it easier to scale applications by distributing the load.
Request:
I would like to request a feature in CanCanCan to support loading resources from the replica database. Currently, while it is possible to load resources using the
load_and_authorize_resource
method, there is no straightforward way to direct these read operations to a replica database.Use Case:
Using the replica database for read-heavy operations such as listing resources or fetching details of a particular resource can enhance performance and reliability. To integrate CanCanCan with the new multi-database feature of Rails 6.1, it would be highly beneficial if the gem provided native support or a configuration mechanism to specify the database from which to load resources.
Suggested Implementation:
load_and_authorize_resource
method to specify which database to use.connected_to
framework to seamlessly switch the connection for specific actions.Example:
The text was updated successfully, but these errors were encountered: