-
Notifications
You must be signed in to change notification settings - Fork 31.2k
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 dbhash
and sqldiff
utilities as JS APIs for working with SQLite
#57637
Comments
I am -1 to shipping additional SQLite utility binaries with Node since anyone can obtain these independently from Node. |
For RBU, we have the possibility that is exposing RBU API |
I'm not sure what you are referring to, could you please be more specific? |
Understandable. It is peculiar that such useful functionality lives in separate binaries. Could there be any other way to expose it in Node while avoiding including them? For example, in my current project (Bachelor's thesis) I have good use cases for |
I don't think so. The fact that SQLite ships them separately says to me that they shouldn't be included at all. I also haven't heard of any other runtimes/libraries that include them (but I haven't checked either). Since both of these things are CLIs, you could always interact with them via the child process API or something similar. It's also important to remember that |
I'm going to close this since this isn't something we are realistically going to add. |
What is the problem this feature will solve?
With SQLite now shipped in Node, as it begins being used in more and more projects, friction points are being discovered.
As pointed to in this issue comment, some features of SQLite require external C/C++ implementations or utility programs to be used.
While not advocating for bloating Node with these programs, I believe a select subset of them can be adopted and integrated directly in Node.
I propose for discussion 2 of them:
dbhash
sqldiff
What is the feature you are proposing to solve the problem?
While I am not experienced enough in C/C++ to work on this, or even acknowledge if it is possible to be done efficiently, I propose investigating the possibility of having Node "wrap" these utility programs and expose them as JS APIs (maybe even in CLI?).
The 2 programs would require separate strategies, as
dbhash
outputs a SHA1 hash (or errors), andsqldiff
creates a file (among other things and outputs, errors, etc.).If the output could be reliably directed towards a Node processing layer (to filter out error messages meant for
stderr
, format the data, disallow anything reachingstdout
, etc.) maybe this could be technically feasible with minimal to no changes to the original scripts, but I cannot approximate the amount of effort required to achieve this level of integration.What alternatives have you considered?
I have not found any other way to easily get the hash of a database's contents. Having an API function/method available with a C implementation would ensure the best efficiency.
Installing the utilities as standalone programs creates setup friction and misses a convenient JS API for using them.
The text was updated successfully, but these errors were encountered: