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
3 answers

Deleting records on a database

I have a logging command which works perfectly, the only issue is I can not finish the off section of the command. I need it to delete both records (guildid, channel) if the guildid matches. This is what I have tried. if (args[0] === 'off') { …
Ragnar Lothbrok
  • 306
  • 1
  • 4
  • 22
1
vote
1 answer

Is there a conditional where statement in SQLite?

I have a Todo application with a database for the todos. It contains a column done which will be set to false or true. Now I want to filter the data by all or unfinished. So either done is irrelevant or it has to be false. I am using SQLite3 in a…
user5444681
0
votes
0 answers

iron-session for database encryption, pros and cons

I'm planning to use encryption to keep sensitive data of my users secure in sqlite3. While thinking of an approach, I'm considering storing all the sensitive date in a single table field as an encrypted JSON object. I will be using iron-session,…
0
votes
0 answers

Having multiple SQLite databases to Reduce Concurrency

I was wondering if it's good practice to have multiple Sqlite databases? My thinking is that I would keep all my relational data in one database and have non-relational data (data that are stored in tables with no-relationship with other tables) in…
Zac Rougeau
  • 19
  • 1
  • 4
0
votes
0 answers

error - ../node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html after installing sqlite3 in nextron app

../node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See…
Ankit
  • 1
  • 1
0
votes
0 answers

TypeError: db.getAsync is not a function (sqlite3 at discord.js v14)

so im trying to create a discord.js v14 code that will work with better-sqlite3 module and once a button is clicked it will check at db, if he already pressed this button (without clicking the offline as well) and the rest of the code is easily…
0
votes
0 answers

better sqlite3 with prebuilds is throwing error when trying to connect with database

node_modules\better-sqlite3-with-prebuilds\build\Release\better_sqlite3.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 93. This version of Node.js requires NODE_MODULE_VERSION 113. Please try re-compiling or…
0
votes
0 answers

Error while downloading better-sqlite3 in windows

The error I get whenever I try and download better-sqlite3: npm ERR! code 1 npm ERR! path C:\Windows\System32\node_modules\better-sqlite3 npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c prebuild-install || node-gyp…
0
votes
1 answer

Best practice to use Sqlite with Electron

I have an Electron app scaffolded using ERB (electron-react-boilerplate) which needs to read and write data from/to a Sqlite database. I am using BetterSqlite3 for the database and React for the renderer. From what I can tell looking at the…
0
votes
1 answer

User defined functions is not working in better-sqlite3

I have a node.js server that connects and initializes a sqlite database. I am using the better-sqlite3 library. But the server never gets started. It gives below error: Tables schema: CREATE TABLE IF NOT EXISTS users ( user_id text …
Wenwu
  • 45
  • 6
0
votes
1 answer

Unable to generate TypeORM migrations when electron ABI differs from installed node

Currently building better-sqlite3 from sources and that works fine but running typeorm migration:generate ends up failing as it uses my local node which has a different ABI version. I would prefer not to have to rebuild before/after migrations if at…
RobDog159
  • 1
  • 1
0
votes
1 answer

Running into some SQLite limitation using IN operator

I have a query that uses WHERE id IN (1,2,3,...) where the list (1,2,3,...) is dynamically generated from an array of integers (not using parameters). Now I have a particular query that takes roughly 500ms with 26623 ids but 50s (100x slower) with…
Prinzhorn
  • 22,120
  • 7
  • 61
  • 65
0
votes
1 answer

How do I handle errors when a row does not exist, using better-sqlite3?

how do I handle the error that happens whenever you try to use .prepare(#).get() and the query does not exist? let businessType = DB.prepare(`SELECT businessType from 'Profiles' WHERE userId = '${author.id}'`).get().businessType; so basically how…
Syntaxis
  • 21
  • 3
0
votes
1 answer

I have a better_sqlite3.node error when i require quick.db

i dont have errors when i install but when i require quick.db in my main.js (its a discord.js bot in v12) const db = require('quick.db') i have an better_sqlite3.node error in my terminal -C:\Users\Fatsah\Desktop\Wizzy…
0
votes
1 answer

Stuggles installing better-sqlite3

I'm currently using webstorm as my IDE of choice, and am trying to install better-sqlite3, but I get this error message every time I attempt an install: Update: I've done everything on the troubleshooting page, and this is the the error message I…
Trev
  • 5
  • 4