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

Add Readyset.route #53

Closed
ethan-readyset opened this issue Dec 12, 2023 · 1 comment · Fixed by #47
Closed

Add Readyset.route #53

ethan-readyset opened this issue Dec 12, 2023 · 1 comment · Fixed by #47
Milestone

Comments

@ethan-readyset
Copy link
Contributor

Brief Description of Feature:
We should add a Readyset.route method that takes a block and routes to ReadySet any queries occurring within the block.

Background:
Our gem is designed around the expectation that ReadySet will be deployed as a read replica of sorts in the context of a Rails application. This adds some friction for developers because they need only route certain queries to ReadySet. To ease the burden of this, we want to provide an easy way for users to annotate that specific queries should be routed to ReadySet.


Optional information to add

Proposed Solution:
Readyset.route should wrap a call to ActiveRecord::Base.connected_to with the shard keyword argument set to the name of the ReadySet database as configured in the user's config/database.yml. By default, the shard name will be :readyset, with an option for users to configure a name manually via our gem's configuration interface.

@ethan-readyset ethan-readyset added the enhancement New feature or request label Dec 12, 2023
@ethan-readyset ethan-readyset added this to the Milestone 1 milestone Dec 12, 2023
@ethan-readyset ethan-readyset removed the enhancement New feature or request label Dec 12, 2023
@ethan-readyset ethan-readyset linked a pull request Dec 12, 2023 that will close this issue
@ethan-readyset
Copy link
Contributor Author

Closed in #47

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

Successfully merging a pull request may close this issue.

1 participant