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

relation: Add .readyset_explain #62

Merged
merged 2 commits into from
Jan 17, 2024
Merged

relation: Add .readyset_explain #62

merged 2 commits into from
Jan 17, 2024

Conversation

ethan-readyset
Copy link
Contributor

@ethan-readyset ethan-readyset commented Jan 2, 2024

This commit adds a .readyset_explain method to our relation extension.
This method invokes EXPLAIN CREATE CACHE upstream on ReadySet and
returns information about the query from ReadySet.

Closes #44

@ethan-readyset ethan-readyset marked this pull request as ready for review January 2, 2024 20:15
@ethan-readyset ethan-readyset changed the title Add Readyset.explain relation: Add .readyset_explain Jan 2, 2024
Copy link
Contributor

@helpotters helpotters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General feedback and a single question about relation_extension.

spec/relation_extension_spec.rb Show resolved Hide resolved
@ethan-readyset
Copy link
Contributor Author

@helpotters Ready for another pass!

Copy link
Contributor

@helpotters helpotters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know what you think!

Resolve at your discretion, but aside from two minor typos and a possible refactor consideration, it's good to go.

lib/readyset/explain.rb Show resolved Hide resolved
lib/readyset/caches.rb Show resolved Hide resolved
lib/readyset/caches.rb Show resolved Hide resolved
ethowitz and others added 2 commits January 17, 2024 15:21
This commit adds a `.readyset_explain` method to our relation extension.
This method invokes `EXPLAIN CREATE CACHE` upstream on ReadySet and
returns information about the query from ReadySet.
This commit adds two rake tasks:
- `readyset:caches:dump`, which reads the caches that exist on the
  connected ReadySet instance and dumps them to a Ruby DSL file
- `readyset:caches:migrate`, which reads the aforementioned Ruby file,
  create the caches from the file that don't exist on ReadySet, and
  drops the caches on ReadySet that don't exist in the file

Closes #9
@ethan-readyset
Copy link
Contributor Author

@helpotters Ready for another pass!

@helpotters helpotters enabled auto-merge January 17, 2024 20:41
@helpotters helpotters added this pull request to the merge queue Jan 17, 2024
Merged via the queue into main with commit 5fc39fb Jan 17, 2024
7 checks passed
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 ActiveRecord::Relation#readyset_explain
3 participants