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

node:sqlite and benchmarking #1266

Open
LqdBcnAtWork opened this issue Sep 25, 2024 · 3 comments · May be fixed by #1334
Open

node:sqlite and benchmarking #1266

LqdBcnAtWork opened this issue Sep 25, 2024 · 3 comments · May be fixed by #1334

Comments

@LqdBcnAtWork
Copy link
Contributor

If you haven't already seen this, Node.js has begun including their own built-in support for sqlite via "node:sqlite". Should we update the benchmark table to include data from this builtin?

Writing a bit of probably terrible code to make the benchmark work. It seems to be a lot better than node-sqlite3, but not quite as good as better-sqlite3. I'm sure some of the performance is lost due to the package being new and untested (and my terrible code). But otherwise it seems at least worth mentioning.

The biggest and most obvious downside is the requirement for the --experimental-sqlite flag. But it's 'already' at Stability 1.1. We'll see if it ever moves to 1.2 or 2.

@LqdBcnAtWork LqdBcnAtWork changed the title node:sqlite and benchmarking node:sqlite and benchmarking Sep 25, 2024
@punkish
Copy link

punkish commented Feb 3, 2025

The biggest and most obvious downside is…

in my view, the inability to compile my own custom SQLite. This is the problem with Bun as well. I am glad that better-sqlite3's included SQLite's compile-time options meet my requirements. But, if they didn't, I am even more glad that I can create my own custom SQLite and use that with better-sqlite3. This is particularly important since I do my dev work on a MacBook and serve the actual app from an Ubuntu VPS.

@LqdBcnAtWork
Copy link
Contributor Author

That's a great point. I never considered that since I have little to no need for changing the underlying SQLite. However being able to is a great boon I'm sure.

I'm not sure how they'd swing that for a built-in though. The best idea I can think of is to take the DatabaseSync class and either make it fancier or to make a different class that wraps around the actual library and can build instances of DatabaseSync.

This would open the option to having multiple versions of SQLite attached to a single Node instance. Which would be all kinds of weird, but someone will probably use it in a really cool way, and a lot of dumb ways. But who am I to judge?

@punkish
Copy link

punkish commented Feb 3, 2025

I never considered that since I have little to no need for changing the underlying SQLite

I need specific extensions and capabilities for my work because of the different envs for development vs production. These capabilities may or (most likely) may not be in the system SQLite that Bun and node use. Even if I didn't need these capabilities, the system's SQLite is usually a few versions behind the latest version. SQLite team releases a new version every few months while most system versions get updated only when the operating system is updated. And the better-sqlite3 team does very well to keep up with those changes.

I do wish I could use Bun (specifically), but for now, I am so very happy that better-sqlite3 exists. I don't foresee that changing in the near- to mid-term future

@weary-adventurer weary-adventurer linked a pull request Feb 28, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants