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
1
vote
1 answer

Discord.js get rank position of user

I want to get the number of users that have a lower number of XP points than the member who used the command, this way I can get his rank. However I don't know much in javascript and sql queries, and I'm hard stuck with this, where it simply returns…
Theoph
  • 11
  • 1
1
vote
0 answers

better-sqlite3 - Could not locate the bindings file

I saw this was quite a common problem - I'm having issues with better-sqlite3 module (version 7.1.0, node version v15.13.0, on Mac). I am trying to run yarn install, but receive the following error: error…
Aviv Ezer
  • 11
  • 1
1
vote
0 answers

electron-forge better-sqlite3 - TypeError: Cannot open database because the directory does not exist

I have a Typescript + Webpack boilerplate from electron-forge. I store my data with better-sqlite3. And copy the database file with copy-webpack-plugin like this: plugins: [ new CopyPlugin({ patterns: [ { from: "src/data/db.db",…
1
vote
0 answers

How to build better-sqlite3 for Electron on Raspberry Pi 3?

I try to run better-sqlite3 in my Electron app on a Rasperry Pi. I get an error from TypeORM at runtime: { constructor: 'Error', name: 'UnhandledRejection DriverPackageNotInstalledError', stack: 'UnhandledRejection…
didil
  • 693
  • 8
  • 22
1
vote
1 answer

Can't get Better-Sqlite3 installed on my Raspberry PI

I'm currently trying to run my Discord Bot on my Raspberry PI but I can't install Better-Sqlite3 on it. I don't really know what to do with all those errors or what they are telling me so I hope someone in here can help me with my problem. If you…
1
vote
1 answer

Find number of columns in a table | Sqlite3

I am using cpp and -lsqlite3 to handle some data. I just wanted to ask about a query that will return the number of columns of a specific table in sqlite. Is it possible to find out?
Hard work
  • 45
  • 3
1
vote
1 answer

Is there a way to get more than 1 value using?

I have a better-sqlite3 statement that orders and ranks my database, and I have a IN statement so I can select more than 1 row. That is where I run into an issue, I need to fetch multiple rows based on a dynamic array of IDs. My SQLITE Statement…
SomePerson
  • 1,171
  • 4
  • 16
  • 45
1
vote
0 answers

Discord.js adding rank feature to XP system using better-sqlite3

Im currently trying to add a rank feature to my already existing xp system. I can return a list from the database, in order of XP no problem, the issue is mapping and indexing. I know it should be simple but im struggling. any help would be greatly…
Evolsurt
  • 31
  • 2
  • 10
1
vote
1 answer

SQLite error "No such column" when I can see that the column exists

The backstory here is that I'm working on a Discord bot. One of the requested functions is having it lob insults. I thought it would be fun to give users the ability to add insults via a SQLite 3 database (specifically, better-sqlite3), and in doing…
1
vote
1 answer

Sqlite how to access each user who has a specific value

I want to get each user who has a specific value in their row and access each of them. I want something like sql.prepare("SELECT * FROM raid WHERE raid1 > 0 AND NOT id='685337576810610734'").get().forEach(async (user) => { …
king
  • 127
  • 1
  • 7
1
vote
0 answers

How to load file into memory node.js? Or put sqlite database into memory?

So i have a sqlite database i run queries on using better-sqlite3, this database is being updated constantly, which will cause the queries i am running to mess up if certain data was changed while it was finishing all the queries. To combat this i…
kyle hoell
  • 117
  • 2
  • 13
1
vote
2 answers

How to pass information from node.js to html

I am building a website in HTML, and I also have a node.js process running that will grab data from an npm package called better-sqlite3. I want to take that data, and show it on my website. I am not exactly sure how to go about pushing the data…
1
vote
2 answers

Reading object returned from "SELECT COUNT(*) FROM table"

let rows = db.prepare("SELECT COUNT(*) FROM table").get(); Returns the object { 'COUNT(*)': 2 } I am not sure how to read that as console.log(rows.COUNT(*)); Returns SyntaxError: Unexpected token *
Aidan
  • 413
  • 3
  • 22
1
vote
1 answer

Building a SQlite/PouchDB supporting React Web App and questions?

My goal Create a React JS WEB APP that can work offline via Service Workers and can query a SQlite file without any backend. I'm running a Linux OS. The problem I'm struggling with SQlite usage on a React Js web application. I'm using…
1
vote
1 answer

Can't install better-sqlite3

I have tried to do node-gyp rebuild and install all the dependencies but still, nothing works here is my error integer@2.1.0 install /media/jeremiah/Discord bot/Discord bot/node_modules/integer > node-gyp rebuild make: Entering directory…
jerry
  • 59
  • 11