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

Added support for non-root effects #358

Merged
merged 2 commits into from
Mar 26, 2023
Merged

Conversation

milessabin
Copy link
Member

@milessabin milessabin commented Mar 19, 2023

  • Added EffectField with one-shot and batched variants.
  • Added EffectHandler type and Effect node to the query algebra.
  • Added EffectElaborator phase which maps selections of effect-mapped fields into Effect nodes.
  • Generalized StagedJson to EffectJson, handling both components and batched effects.
  • Simplified effect/stage grouping/batching logic.
  • Renamed and simplified Mapping#combineQueries to combineAndRun. This also replaces QueryInterpreter#runRootValues which has been removed.
  • Several root APIs (eg. defaultRootCursor) which were previously parameterized with a Type and/or an Env are now parameterized with an optional parent Cursor. This allows for more uniform inheritance of runtime attributes between components.
  • Removed redundant Defer node from the query algebra.
  • Reordered the arguments to the component join for consistency.

@milessabin milessabin self-assigned this Mar 19, 2023
Copy link
Member

@tpolecat tpolecat left a comment

Choose a reason for hiding this comment

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

This looks great and I think it will cover our immediate needs. 👍 🎉

I do have a few general questions (inline and below).

There will be some confusion about RootEffect vs. EffectMapping, so could you say a little bit about their differences and when you should use one vs. the other? For instance is the RootEffect.computeCursor case subsumed by EffectMapping?

The example here computes a CirceCursor, but would it be possible to compute a SqlCursor, if for example you need to do intermediate web request in order to gather parameters for a follow-on SQL query? If so, an example would be helpful.

Thanks!

+ Added EffectMapping with one-shot and batched variants.
+ Added EffectHandler type and Effect node to the query algebra.
+ Added EffectElaborator phase which maps selections of effect-mapped
  fields into Effect nodes.
+ Generalized StagedJson to EffectJson, handling both components and
  batched effects.
+ Simplified effect/stage grouping/batching logic.
+ Renamed and simplified Mapping#combineQueries to combineAndRun. This
  also replace QueryInterpreter#runRootValues which has been removed.
+ Several root APIs (eg. defaultRootCursor) which were previously
  parameterized with a Type and/or an Env are now parameterized with an
  optional parent Cursor. This allows for more uniform inheritance of
  runtime attributes between components.
+ Removed redundant Defer node from the query algebra.
+ Reordered the argument to the component join for consistency.
+ Renamed EffectMapping to EffectField.
+ Added scaladoc for PossiblyRenamedSelect.
+ Added sqlCursor method similar to circeCursor, valueCursor etc.
+ Extended test to illustrate making a follow on SQL query driven by
  values returned from an intermediate service request.
@milessabin milessabin merged commit f00b445 into main Mar 26, 2023
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