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

feature-request - include sqlite3 as builtin module for node v9.x #15128

Closed
kaizhu256 opened this issue Sep 1, 2017 · 10 comments
Closed

feature-request - include sqlite3 as builtin module for node v9.x #15128

kaizhu256 opened this issue Sep 1, 2017 · 10 comments
Labels
feature request Issues that request new features to be added to Node.js.

Comments

@kaizhu256
Copy link
Contributor

kaizhu256 commented Sep 1, 2017

  • Version: 9.x
  • Platform: all
  • Subsystem: node builtins

i'm generally happy with nodejs keeping the codebase lean and free of cruft, but sqlite3 is the one exception. it would allow us to write standalone, PERSISTENT webservers in embedded systems with zero-dependencies. recent activity indicates code for the sqlite3 npm-package has stabilized:

@mscdex
Copy link
Contributor

mscdex commented Sep 1, 2017

-1 this is best left to userland.

@kaizhu256
Copy link
Contributor Author

but you have to admit, there are many times when writing "throwaway" scripts on remote/unfamiliar machines, you wished there was a builtin and portable way to persist data other than read/write json files ;)

@XadillaX
Copy link
Contributor

XadillaX commented Sep 1, 2017

I'm -1 on this too.

@joyeecheung
Copy link
Member

joyeecheung commented Sep 1, 2017

FWIW, one solution is to create your custom version of Node.js by packging sqlite3 as a builtin module, so it does not have to be done in this repo. I am not sure if there is an existing guide on how to do this, but #10187 can be a reference on how to integrate a npm module into Node core.

EDIT: should've link to the PR instead of the commit..

@kaizhu256
Copy link
Contributor Author

kaizhu256 commented Sep 1, 2017

that's a worse solution than npm-installing. there are common use-cases where you would want to write a quick-and-dirty script to transpose/sort/serve a 100mb spreadsheet-like data, with a bare vm and vanilla nodejs, and not bother with the flakiness of npm-install. a builtin sqlite3 would make these expendable scripts simpler and more practical.

e.g. perhaps a 200-line portable standalone script to transform/save datapoints, and then export it in highcharts-format for visualization with various transpose/sort/filter parameters.

@joyeecheung
Copy link
Member

joyeecheung commented Sep 1, 2017

@kaizhu256 That's true. But, y'know, the same can be said about numerous packages on https://www.npmjs.com/browse/depended

@kaizhu256
Copy link
Contributor Author

@joyeecheung , just going thru the list you presented and why are less useful than sqlite3 for quick-scripting:

pretty much everything in that list either has no use-case in throw-away scripting or is redundant to builtins in some way. sqlite3, however is not.

@benjamingr
Copy link
Member

Another -1 on this.

You can install sqlite3 in a single shell command.

Node.js has a philosophy of doings its best to enable a good package ecosystem but not pick sides.

Adding something like sqlite3 in Node.js core would have to show a distinct advantage over doing so in userland.

but you have to admit, there are many times when writing "throwaway" scripts on remote/unfamiliar machines, you wished there was a builtin and portable way to persist data other than read/write json files ;)

I agree, and npm installing it is an excellent way to make sure Node.js supports both sqlite3 and every other database a driver is written for.

@joyeecheung
Copy link
Member

joyeecheung commented Sep 1, 2017

@kaizhu256 Not every throw-away script is the same. For some throw-away scripts, writing and reading JSON files are pretty enough for persistent storage (in fact "throw-away" seems a bit at odds with "persistent", I would say a lot of scripts only need in-memory storage), for others they are not. This can be said about "using Date v.s. moment" (like for people who does not/does need locales for datetimes), .etc, as you have described, and npm is a good solution to this problem.

@cjihrig
Copy link
Contributor

cjihrig commented Sep 1, 2017

I'm also -1 on this. Given the feedback so far, and the fact that we are extremely unlikely to add this feature, I'm going to close this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js.
Projects
None yet
Development

No branches or pull requests

6 participants