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

ZQuery Improvements #200

Merged
merged 2 commits into from
Feb 5, 2020
Merged

ZQuery Improvements #200

merged 2 commits into from
Feb 5, 2020

Conversation

adamgfraser
Copy link
Contributor

Improvements to ZQuery based on recent suggestions:

  • Query metrics - implements summarized and timed methods on ZQuery analogous to existing methods on ZIO. These do not interfere with query batching.
  • Optional data sources - implements fromRequestOption constructor on ZQuery to construct queries that return None instead of failing with a QueryFailure if a data source does not return a result for a request. Implements fromFunctionOption, fromFunctionOptionM, fromFunctionBatchedOption, and fromFunctionBatchedOptionM to create data sources that may not return a result for a request.
  • More support for data sources that can fail - fromFunctionBatchedWithM now also allows you to use an effect that can fail. If the effect fails the failure will be returned for all requests.

@adamgfraser
Copy link
Contributor Author

All set.

Copy link
Owner

@ghostdogpr ghostdogpr left a comment

Choose a reason for hiding this comment

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

Thanks!

@ghostdogpr ghostdogpr merged commit 2a7c53b into ghostdogpr:master Feb 5, 2020
@adamgfraser adamgfraser deleted the zquery branch February 5, 2020 03:46
* and then combining the values to produce a summary, together with the
* result of execution.
*/
final def summarized[R1 <: R, E1 >: E, B, C](f: (B, B) => C)(summary: ZIO[R1, E1, B]): ZQuery[R1, E1, (C, A)] =
Copy link
Owner

Choose a reason for hiding this comment

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

Shall we switch the parameters here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. I was slightly inclined to wait until RC18 and make conforming changes to that so we track the public ZIO API for identical methods but happy to change now as well.

Copy link
Owner

Choose a reason for hiding this comment

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

Ah ok, either way's fine 👍

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.

2 participants