Questions tagged [better-sqlite3]

Better-SQLite3 is a Node.js API for SQLite3, claiming ease-of-use, improved efficiency and faster processing.

Better-SQLite3 is an API for use with Node.js, It differs from other popular SQLite3 API's in that it is synchronous rather than asynchronous.

  • It claims speed improvements of between 3 and 28 times over other similar API's.
  • Support for 64bit Integers.
  • Simplicty and efficiency.
  • Custom SQL
  • Full transaction Support.

The SQLite compilation options include:-

  • Foreign Key enabled by default.
  • Larger cache size.
  • R-Tree extension added for improved Range queries.
  • Latest Full Text Search Engine (FTS5)

For more Information see better-sqlite3

109 questions
18
votes
2 answers

'GetContents' in 'v8::ArrayBuffer'

I'm using Mac M1 and I've just upgraded to Node 14.17.6LTS. I tried to rebuild better_sqlite3 (7.4.3) using with electron builder (22.11.7) and I'm getting the following errors: no member named 'GetContents' in 'v8::ArrayBuffer' Any ideas how to…
gsy
  • 327
  • 1
  • 4
  • 10
11
votes
1 answer

How can i use TypeORM with better-sqlite3

How can i use TypeORM with better-sqlite3? on the official documentation, there is a section form better-sqlite3. I already installed by typeorm@latest and typeorm@next but there is no options for better-sqlite3 yet. If i try to force initialize it,…
Daniel Santos
  • 14,328
  • 21
  • 91
  • 174
9
votes
2 answers

Updating a value in SQL (better-sqlite3) with Node.JS

I currently have a database of people with each individual person and they hold a status value. I am trying to change their status value. const id = parseInt(req.params.id , 10); const { valid, messageObj } = validateId(id); if (!valid) { …
Danjuro
  • 141
  • 1
  • 8
8
votes
2 answers

How to integrate sqlite3 in Sveltekit?

I have been using sqlite3 for most of my fullstack applications (node/express, django/drf + svelte on the front end as the consumer of the api endpoints) and have been trying to figure out how to integrate sqlite3.
7
votes
1 answer

How do I turn a node app into a VS Code extension?

I have built a node app that uses a module to work with a database (better-sqlite3). It works fine as a node app. but, Now I am trying to make a VS Code extension that has most of the same functionality. However, when I install the module, build,…
5
votes
1 answer

better-sqlite3 - compiled against a different Node.js - discord.js bot

/Users/dhyan/Downloads/Dhyan99-bot-v14 (4)/node_modules/bindings/bindings.js:121 throw e; ^ Error: The module '/Users/dhyan/Downloads/Dhyan99-bot-v14 (4)/node_modules/better-sqlite3/build/Release/better_sqlite3.node' was compiled…
D99
  • 84
  • 6
5
votes
1 answer

sqlite3 + node: when to close db?

I'm using better-sqlite3 on Node, but I suspect my questions are applicable to node-sqlite3 as well. I basically have 2 simple questions, relating to a server-rendered website: Do I need to explicitly call .close() on the database? I seem to…
Zoltán Matók
  • 3,923
  • 2
  • 33
  • 64
5
votes
4 answers

Error: Could not locate the bindings file better-sqlite3.node

The Problem There are some problem with maybe my installation of better-sqlite3 because when I try to execute my index.js (click to show it on pastebin) with node index.js there is always the same result. I tried on MacOS, it works but in my…
mandaputtra
  • 922
  • 3
  • 18
  • 36
4
votes
1 answer

Password Protect a "better-sqlite3" DB file

I have an electron-angular-node project which has few tables. I am using : electron version: 13.1.7 Angular CLI: 12.0.2 Node: 16.17.0 Package Manager: npm 9.2.0 OS version: Windows 10 better-sqlite3: 7.4.6 I need to protect the DB file in case…
4
votes
1 answer

Create new table using better-sqlite3

I am trying to create a new table using node.js and better-sqlite3. When I execute the file, it returns the following error: ReferenceError: createtable is not defined at Object. (...my file's path...) How can I solve it? Here's my…
hellomynameisA
  • 546
  • 1
  • 7
  • 28
4
votes
2 answers

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,…
hellomynameisA
  • 546
  • 1
  • 7
  • 28
4
votes
0 answers

Unable to test better-sqlite3 within a project based on electron-vue boilerplate

I used electron-vue to generate the base for my project. I can get my application to launch, however when I attempt to run yarn test, I get the following error: Child html-webpack-plugin for "index.html": Asset …
djsumdog
  • 2,560
  • 1
  • 29
  • 55
3
votes
4 answers

Issue installing better-sqlite3 on Mac

The reason I'm trying to install it is to use quick.db as its the default driver however I can't seem to figure out what the error is. Perhaps the kind people of stack overflow will be able to provide some assistance. It seems like it manages to run…
larkx
  • 71
  • 1
  • 9
2
votes
1 answer

does the db connection stay open in the context of a node server?

this is more of a basic question, trying to clear up my understanding… usually if I have a simple program such as below, it creates a db connection and then closes it once the script exits import Database from 'better-sqlite3'; const db = new…
punkish
  • 13,598
  • 26
  • 66
  • 101
2
votes
0 answers

How to use electron with better-sqlite3?

We have an electron application with better-sqlite3. It is using electron-webpack with better-sqlite3. Now I have to upgrade the application's packages because they are back from 2020. The only problem with that is that installing better-sqlite3 has…
Xallum
  • 21
  • 2
1
2 3 4 5 6 7 8