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

poc: allow extracting individual steps (#2065) #2154

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ulfryk
Copy link
Contributor

@ulfryk ulfryk commented Nov 28, 2024

@jatcwang a promised PoC so we can make some decisions early on :)

@ulfryk ulfryk force-pushed the feat/2065-allow-extracting-individual-steps-when-executing-query-or-update branch from f3787de to a70a98c Compare November 28, 2024 13:03
@@ -226,6 +248,18 @@ object connection {
} yield ele
}

def stream[A: Read](
prepared: PreparedExecutionStream,
loggingInfo: LoggingInfo
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure these methods are really needed? Especially since the current API does not really allow users to work with (execute) a PreparedExecutionStream directly

@jatcwang
Copy link
Collaborator

I agree with the overall direction you're going with this. I think it will provide most if not all of the customizations users will need 👍

@ulfryk ulfryk force-pushed the feat/2065-allow-extracting-individual-steps-when-executing-query-or-update branch from a70a98c to 91effe2 Compare December 18, 2024 16:39
@ulfryk ulfryk force-pushed the feat/2065-allow-extracting-individual-steps-when-executing-query-or-update branch from 592f967 to 1423839 Compare December 18, 2024 20:29
@ulfryk ulfryk force-pushed the feat/2065-allow-extracting-individual-steps-when-executing-query-or-update branch from 82a5749 to d91641a Compare December 19, 2024 14:27
@ulfryk
Copy link
Contributor Author

ulfryk commented Dec 19, 2024

@jatcwang

Methods added to Query class:

  • toAlteringExecution (as to)
  • toMapAlteringExecution (as toMap)
  • accumulateAlteringExecution (as accumulate)
  • uniqueAlteringExecution (as unique)
  • optionAlteringExecution (as option)
  • nelAlteringExecution (as nel)

Methods added to Update class:

  • runAlteringExecution (as run)
  • updateManyAlteringExecution (as updateMany)
  • withUniqueGeneratedKeysAlteringExecution (as withUniqueGeneratedKeys)

So basically all operations returning ConnectionIO.
As suggested in #2154 (comment) I have skipped ones yielding Stream.


Now some questions:

  • should we use this name pattern - …AlteringExecution suffix?
  • should we add similar methods to the Query0 and Update0 traits?

@jatcwang
Copy link
Collaborator

jatcwang commented Jan 4, 2025

Thanks this looks good! Sorry for the late reply.

I think AlteringExection is good! One other possibility I can think of is Customized e.g. toMapCustomized.

Yes we'll need to add these to Query0 and Update0 too

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