Skip to content

Use better-sqlite3 #11400

Open
Open

Description

@sushantdhiman

Thinking about using better-sqlite3 for SQLite database, mainly for supporting 64bit Integers. Their benchmark looks great as well

WiseLibs/better-sqlite3#262

Activity

  1. added
    status: in discussion
    type: refactor
    dialect: sqlite
    breaking change
    on Sep 7, 2019
  2. added this to the v6 milestone on Sep 7, 2019
  3. pinned this issue on Sep 7, 2019
  4. papb commented on Sep 7, 2019

    @papb
    Member

    Completely agreed!!

  5. usebaz commented on Oct 15, 2019

    @usebaz

    @sushantdhiman Hi, if need help I can make PR with migrate to better-sqlite3

  6. sushantdhiman commented on Oct 15, 2019

    @sushantdhiman
    ContributorAuthor

    @usebaz Thanks. Soon master branch will point to the next beta. After that you can submit your PR

  7. etylermoss commented on May 4, 2020

    @etylermoss

    Is there any update on this?

  8. sushantdhiman commented on May 7, 2020

    @sushantdhiman
    ContributorAuthor

    @etylermoss Currently no one is working on this. I tried to convert some time ago but found that API is really annoying :)

    For example,

    1. run, (only on statements that do not return data)
    2. get (only on statements that return data)

    This mean as an ORM we need to check what kind of query is going to execute (will it return data?) and switch methods based on that. I think this is unnecessary complication.

    I wish they could just provide simple method to execute any arbitrary query (with parameters) like every other dialect library in existence.

    So officially we want to switch but we are not working on it. If someone want to do a PR for this, we will welcome that change.

  9. louy2 commented on May 18, 2020

    @louy2
    Contributor

    How is it handled with node-sqlite3 currently? It has the same run/get split.

  10. changed the title [-]V6: Use better-sqlite3[/-] [+]Use better-sqlite3[/+] on Jun 24, 2020
  11. removed this from the v6 milestone on Jun 24, 2020
  12. unpinned this issue on Jun 25, 2020
  13. 16 remaining items

  14. j-refs commented on Jan 30, 2024

    @j-refs

    Is this still not being worked on? If the maintainers approve, I'll gladly open a fork open to the community to get this feature up and running and PR it.

    After a quick scan of the source, it doesn't really seem as hard as every is making it, seems like the regular sqlite dialect can be easily modified for better-sqlite3, but I just don't have the time to scan and port everything, maybe if we make it a community effort, we can get this done

  15. WikiRik commented on Jan 30, 2024

    @WikiRik
    Member

    @j-refs internally this has been postponed to v8 when we split dialects. If you can make it so that users can select which of the two adapters they want to use, we can reconsider adding this to v7.

    If you create a fork, please mention it here in this issue as well so we can refer people to it in the meantime

  16. j-refs commented on Jan 30, 2024

    @j-refs

    Will look into forsure. Probably later today, I work nights and I'm ready to KO. Any info the maintainers wanna add in before I form?

  17. yisar commented on Feb 23, 2024

    @yisar

    any updates?

  18. j-refs commented on Feb 25, 2024

    @j-refs

    Yes sorry, struggling to find time to get started on this, but is definitely on my queue

  19. j-refs commented on Mar 4, 2024

    @j-refs

    I'm ready to start working on this. Would y'all prefer a branched PR or it's own repo?

  20. ephys commented on Apr 8, 2024

    @ephys
    Member

    @j-refs So sorry, I did not see your latest message

    The SQLite package has been split to its own package (https://github.com/sequelize/sequelize/tree/main/packages). You can fork the repository, create a new package called better-sqlite3, and open a PR to this repository :)

    As we're opting for providing both @sequelize/sqlite3 and @sequelize/better-sqlite3, this won't be a breaking change after all

    Note that @sequelize/better-sqlite3 cannot extend @sequelize/sqlite3 directly to avoid installing both sqlite3 and better-sqlite3. Instead, anything that you wish to re-use from @sequelize/sqlite3 should be moved to an internal package, @sequelize/abstract-sqlite

  21. added
    dialect: new
    and removed
    status: in discussion
    breaking change
    type: refactor
    on Apr 8, 2024
  22. 0xslipk commented on Dec 19, 2024

    @0xslipk

    @ephys I will start working on this. Do you guys have something already in progress that can work or help with?

  23. j-refs commented on Jan 8, 2025

    @j-refs

    @j-refs So sorry, I did not see your latest message

    The SQLite package has been split to its own package (https://github.com/sequelize/sequelize/tree/main/packages). You can fork the repository, create a new package called better-sqlite3, and open a PR to this repository :)

    As we're opting for providing both @sequelize/sqlite3 and @sequelize/better-sqlite3, this won't be a breaking change after all

    Note that @sequelize/better-sqlite3 cannot extend @sequelize/sqlite3 directly to avoid installing both sqlite3 and better-sqlite3. Instead, anything that you wish to re-use from @sequelize/sqlite3 should be moved to an internal package, @sequelize/abstract-sqlite

    I was not able to put any effort into this sorry. I ran into some major medical issues and am kind of barely getting backaround

  24. Steve-Mcl commented on Jan 27, 2026

    @Steve-Mcl

    FYI: sqlite3 now officially deprecated.

    Image

    TryGhost/node-sqlite3@a85f9e8

    Wondering if anyone is using a fork which doesnt have the TAR CVE

    tar  <=7.5.3
    Severity: high
    node-tar is Vulnerable to Arbitrary File Overwrite and Symlink Poisoning via Insufficient Path Sanitization - https://github.com/advisories/GHSA-8qq5-rm4j-mr97
    Race Condition in node-tar Path Reservations via Unicode Ligature Collisions on macOS APFS - https://github.com/advisories/GHSA-r6q2-hw4h-h46w
    
    $ npm ls tar
    blahblah
    └─┬ [email protected]
      ├─┬ [email protected]
      │ ├─┬ [email protected]
      │ │ └─┬ [email protected]
      │ │   └── [email protected] deduped
      │ └── [email protected] deduped
      └── [email protected]
    
  25. HoldYourWaffle commented on Apr 15, 2026

    @HoldYourWaffle

    Worth noting that the first-party node:sqlite module moved to release candidate in Node v25.7.

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

    dialect: newdialect: sqlite

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions