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

Incremental Blob Support #424

Closed
mgd134 opened this issue Mar 2, 2015 · 4 comments
Closed

Incremental Blob Support #424

mgd134 opened this issue Mar 2, 2015 · 4 comments

Comments

@mgd134
Copy link

mgd134 commented Mar 2, 2015

Hi,

I'd like incremental blob support in node-sqlite3.

https://www.sqlite.org/c3ref/blob_open.html

I have forked the repo and added a prototype of the functionality that currently works. I'm not quite sure what to make of the concurrency framework (uv_work_queue stuff) and the callbacks, however. I'm happy to finish it if someone can point me in the right direction and if you guys wouldn't mind merging it when it is done to your satisfaction.

I didn't want to create a pull request quite yet due to the issues noted above.

Thanks for any guidance,
Mike

@springmeyer
Copy link
Contributor

If you have specific questions about the uv_work - please ask.

If you are keen to submit a pull test coverage will be important.

@mgd134
Copy link
Author

mgd134 commented Mar 2, 2015

OK, I just want to be sure I understand correctly how the concurrency stuff works. Here's the way I'm reading the code, using Database::Exec as an example:

The NAN_METHOD(Database::Exec) is used to make sure the user passes in the correct parameters, create the baton, and schedule the Work_BeginExec function to run at some point later.

The Work_BeginExec method is used to do a few sanity checks and then put the Work_Exec method on the queue. This schedules Work_Exec to be run on a new thread and then Work_AfterExec to run when Work_Exec finishes, correct?

The Work_Exec method actually runs the sqlite3 command.

The Work_AfterExec method checks for errors and calls the callback if one exists.

Do I have this understanding correct? How do I decide if I need all of these separate steps for the APIs I'm adding?

I can add some test cases for the new API.

@springmeyer
Copy link
Contributor

The Work_BeginExec method is used to do a few sanity checks and then put the Work_Exec method on the queue. This schedules Work_Exec to be run on a new thread and then Work_AfterExec to run when Work_Exec finishes, correct?

correct.

Do I have this understanding correct? How do I decide if I need all of these separate steps for the APIs I'm adding?

You need those separate API's if you want to avoid blocking the main loop.

If you have a pull request, queue it up for others to play with. Be clear about what it makes possible!

@daniellockyer
Copy link
Member

This would be nice but the issue has gone stale so I'm going to close for now - please reopen with an issue template if it's still something that is desired

@daniellockyer daniellockyer closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants