Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between sqlite and better-sqlite3 implementation

What's the difference between sqlite and better-sqlite3 implementations? I have to use better-sqlite3 to create a database for a form (+ only node.js and express), but the only clear example I found uses sqlite. Is there any difference? If not, thanks. Otherwise, do you know any usefull links for databases and forms with better-sqlite3? Thanks

like image 666
hellomynameisA Avatar asked Aug 28 '26 15:08

hellomynameisA


2 Answers

In better-sqlite3, you can register custom functions and aggregate functions written in JavaScript, which you can run from within SQL queries.

In better-sqlite3, you can iterate through the cursor of a result set, and then stop whenever you want (you don't have to load the entire result set into memory).

In better-sqlite3, you can conveniently receive query results in many different formats (here, here, and here).

In better-sqlite3, you can safely work with SQLite's 64-bit integers, without losing precision due to JavaScript's number format.

See https://github.com/JoshuaWise/better-sqlite3/issues/262

One important difference is: better-sqlite allows for synchronous SQLite queries. With sqlite, you can't do that.

like image 28
Matthias Reissner Avatar answered Aug 31 '26 17:08

Matthias Reissner



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!