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

Direct access to SqlDataReader #21

Open
nozzlegear opened this issue Oct 30, 2021 · 1 comment
Open

Direct access to SqlDataReader #21

nozzlegear opened this issue Oct 30, 2021 · 1 comment

Comments

@nozzlegear
Copy link
Contributor

nozzlegear commented Oct 30, 2021

Hey! I've got a usecase where a stored procedure returns multiple result sets that I need to parse. To do this, I need access to the SqlDataReader so I can call reader.NextResult() to move to the next result set. I see that the RowReader type lets us access the reader, but given the Sql.execute function reads the rows and advances the reader automatically, I'm not sure this will work the way I need it to. I'd need to somehow detect that the reader is on its last row and then advance it to the next result before the execute function's loop ends.

Would it be possible to add an executeReader function? Something like this:

let executeReader (read: SqlDataReader -> 't) (props: SqlProps) : 't =
	// ...

I'd be happy to create a pull request for it if you're interested in adding support for it.

@AlbertoDePena
Copy link

@nozzlegear I would love to see that PR... I also have the same use case... Anything I can do to help, just let me know =)

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

No branches or pull requests

2 participants