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

routing: Add Readyset.route #47

Merged
merged 7 commits into from
Dec 13, 2023

Conversation

ethan-readyset
Copy link
Contributor

Adds a Readyset.route method, which takes a block and routes to
ReadySet all the queries that occur within that block.

NOTE: This PR is stacked on top of #46 and must be merged after that is merged

@ethowitz ethowitz force-pushed the add-route-and-exclude branch from 365a809 to 6be2525 Compare December 8, 2023 22:28
@ethowitz ethowitz force-pushed the remove-resolver branch 2 times, most recently from fdf7bd5 to ade0285 Compare December 8, 2023 22:30
@ethowitz ethowitz force-pushed the add-route-and-exclude branch from 6be2525 to a1ab38c Compare December 8, 2023 22:30
Our approach to routing queries requires more granularity than is
provided by the ActiveRecord middleware, so this commit removes the code
that integrates with that middleware.
Adds a `Readyset.route` method, which takes a block and routes to
ReadySet all the queries that occur within that block.
@ethowitz ethowitz force-pushed the add-route-and-exclude branch from a1ab38c to 40433b0 Compare December 8, 2023 22:50
@helpotters
Copy link
Contributor

Sorry, I didn't notice the dependency on PR #41. Reverted for now.

lib/readyset.rb Show resolved Hide resolved
lib/readyset.rb Outdated Show resolved Hide resolved
lib/readyset.rb Show resolved Hide resolved
@ethan-readyset ethan-readyset linked an issue Dec 12, 2023 that may be closed by this pull request
@ethan-readyset
Copy link
Contributor Author

@helpotters Fixed the prevent_writes docs and replied to your questions!

Base automatically changed from remove-resolver to add-relation-extension December 13, 2023 09:13
@helpotters
Copy link
Contributor

Merging after #46

@helpotters helpotters merged commit bc2894a into add-relation-extension Dec 13, 2023
4 of 8 checks passed
This was referenced Dec 13, 2023
github-merge-queue bot pushed a commit that referenced this pull request Dec 13, 2023
Reopening as it doesn't look like this was merged properly. Contains the
same changes that were in #47, but this time, the base branch is `main`
helpotters pushed a commit that referenced this pull request Dec 15, 2023
Reopening as it doesn't look like this was merged properly. Contains the
same changes that were in #47, but this time, the base branch is `main`
github-merge-queue bot pushed a commit that referenced this pull request Dec 15, 2023
…y` syntax (#48)

This commit adds an extension to `ActiveRecord::Base` that defines a
`readyset_query` class method. This class method provides an easy
interface for users to define named queries within the context of their
models such that the queries will be routed to ReadySet.

NOTE: This PR is stacked on top of #47 and should only be merged after
that PR is merged

Closes #3
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 this pull request may close these issues.

Add Readyset.route
3 participants