Skip to content

Conversation

bjouhier
Copy link
Contributor

This is a first pass on a reader API. I've added a section to the README.

I've tried to disturb the existing code as little as possible. There is some overlap between Connection::Execute and Reader::NextRows so the code could be refactored a bit.

I have added a unit test and also tested with our application. It seems to work but here may be memory leaks. I'm going to stress it more in the coming days.

I've also added a few lines of code to map RAW and ROWID types. This is only temporary (RAW should probably be mapped to Buffer rather than string) but it helped me test with our app.

Note: this is a reader rather than a cursor because there is no API to act on a current record. The records are read with a window, which optimizes for cases where we scan large results sets from beginning to end.

@bjouhier
Copy link
Contributor Author

Related to #62 and #115

@bjouhier
Copy link
Contributor Author

@joeferner There was a serious memory/cursor leak in my original PR (reader was never destructed). I have fixed it and tested both with 0.10.x and 0.11.10.

Let me know what you want to do with it. If you have better ideas for the API, we can discuss here and I'll adjust and resubmit the PR.

joeferner added a commit that referenced this pull request Jan 31, 2014
@joeferner joeferner merged commit 07f03a5 into joeferner:master Jan 31, 2014
@bjouhier bjouhier deleted the reader branch January 31, 2014 13:33
@bjouhier
Copy link
Contributor Author

@joeferner Thanks for accepting the PR.

I'm testing more and I'm running into a segfault with a program that I had not run before. I found a simple solution which avoids the MakeWeak hack that I had introduced to free the callback. I'll stress it more and send you another small PR later.

Sorry for that. I'm still on the learning curve with the V8's APIs.

Bruno

@bjouhier bjouhier restored the reader branch February 1, 2014 11:12
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