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

add: *SelectSQL.IterContext is returns iter.Seq2[*, error]. #49

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

mackee
Copy link
Owner

@mackee mackee commented Sep 9, 2024

Description

This PR adds a new IterContext method to the generated code.

Key Features:

  • IterContext returns iter.Seq2[{{ row struct }}, error] and a closer.
  • Allows processing rows one by one using the syntax: for row, err := range rows.
  • When combined with github.com/BooleanCat/go-functional/v2/it's TryCollect, it can retrieve results similar to AllContext.
  • Enables the use of for range in scenarios where you want to filter query results or transform them into another type.

@mackee mackee merged commit 9efc604 into master Sep 9, 2024
1 check passed
@mackee mackee deleted the feature/iter branch September 9, 2024 02:30
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.

1 participant