镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

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

Description

@kaizhu256
  • 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:

Activity

  1. mscdex commented on Sep 1, 2017

    @mscdex
    Contributor

    -1 this is best left to userland.

  2. kaizhu256 commented on Sep 1, 2017

    @kaizhu256
    ContributorAuthor

    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 ;)

  3. XadillaX commented on Sep 1, 2017

    @XadillaX
    Contributor

    I'm -1 on this too.

  4. joyeecheung commented on Sep 1, 2017

    @joyeecheung
    Member

    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..

  5. kaizhu256 commented on Sep 1, 2017

    @kaizhu256
    ContributorAuthor

    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.

  6. joyeecheung commented on Sep 1, 2017

    @joyeecheung
    Member

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

  7. kaizhu256 commented on Sep 1, 2017

    @kaizhu256
    ContributorAuthor

    @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.

  8. benjamingr commented on Sep 1, 2017

    @benjamingr
    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.

  9. joyeecheung commented on Sep 1, 2017

    @joyeecheung
    Member

    @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.

  10. cjihrig commented on Sep 1, 2017

    @cjihrig
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues requesting new Node.js features.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions