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

Make stream more general #54

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

johannesgerer
Copy link

Sometimes the setup of the state needs to know the number and potentially names of the columns. What do you think about this change?

@johannesgerer
Copy link
Author

Polite bump...

Without this I currently have to maintain a fork to be able to access the internal module.

I would really appreciate it if this (or similar functionality) could be provided.

@johannesgerer
Copy link
Author

Is there anything I can do to make this easier for you to accept/think about?

Copy link
Contributor

@spencerjanssen spencerjanssen left a comment

Choose a reason for hiding this comment

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

Disclaimer: I don't maintain this package, I'm just an interested party.

I think this is a good idea! I'm interested in using this in my employer's codebase. We have a home-grown class for deserializing [(Column, Value)] rows into domain types. Currently we validate the column names for every row in the result set. With this change we could instead validate the column names and count once per result set.

For the sake of backwards compatibility, perhaps we should instead introduce new streaming functions instead of changing the types of the existing ones?

@@ -360,7 +360,7 @@ streamWithParams ::
-> (state -> [(Column, Value)] -> m (Step state))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
-> (state -> [(Column, Value)] -> m (Step state))
-> (state -> [Value] -> m (Step state))

Given that state is now derived from our columns, does it make sense to remove Column here?

@chrisdone
Copy link
Contributor

Disclaimer: I don't maintain this package, I'm just an interested party.

I think this is a good idea! I'm interested in using this in my employer's codebase. We have a home-grown class for deserializing [(Column, Value)] rows into domain types. Currently we validate the column names for every row in the result set. With this change we could instead validate the column names and count once per result set.

For the sake of backwards compatibility, perhaps we should instead introduce new streaming functions instead of changing the types of the existing ones?

I agree on introducing new ones with new names. Otherwise the changes sound good.

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.

None yet

3 participants