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
2
votes
1 answer

Count amount of arrays in a database

I have a database and I will lay out an example. guildid botid 1234 ["2345","3456","3714","1812"] 9876 ["8765","5432"] 4346 NULL 2371 ["3179"] 1254 NULL 1257 ["1721","7104","8265"] 8321 NULL I need to…
Ragnar Lothbrok
  • 306
  • 1
  • 4
  • 22
2
votes
1 answer

Using better-sqlite3 in an Angular + Electron app: Module parse failed: Unexpected character

In my Angular + Electron app I'm trying to install some sqlite library in order to read contents from an sqlite database file. I've installed better-sqlite3 using: npm install --save better-sqlite3 npm install --save-dev @types/better-sqlite3 And…
Francesco Borzi
  • 56,083
  • 47
  • 179
  • 252
2
votes
1 answer

need a way around the "node running out of memory" error

I am parsing ~250K XMLs and loading the data into a SQLite database. I am using node version 10.15.1 with cheerio and better-sqlite3 on a Mac OS X laptop with 8GB memory. I am readdirSync-ing the entire folder of ~250K files, and parsing the XML…
punkish
  • 13,598
  • 26
  • 66
  • 101
2
votes
0 answers

Get the sibling value of a SQLITE value

I have a SQLite Table: +---------+-----------+-----------+-----------+ | userID | balance | ledger | lasttopup | +---------+-----------+-----------+-----------+ | 1 | 90 | 780 | 12/10/18 | | 2 | 180 | 0…
KaceEnigma
  • 46
  • 4
2
votes
0 answers

npm install fails on Windows when better-sqlite3 is in the package.json

When executing "npm install" for my node application, I suddenly started getting the error: Could not load the Visual C++ component "VCBuild.exe" I have narrowed it down to the following line in the package.json file under…
Edward Tanguay
  • 189,012
  • 314
  • 712
  • 1,047
1
vote
1 answer

How to deserialize SQlite to TS class?

Using Sqlite3 from Electron's main package, I am able to create tables, insert rows, and read those rows. How do I instantiate rows read into defined classes? Example: export const GetAllObjs = (): Obj[] => { const query = db.prepare("SELECT *…
ScumSprocket
  • 347
  • 5
  • 16
1
vote
0 answers

I've a fatal problem for install better-sqlite3

Node.js version is 18.14.1 npm version is 9.3.1 VS studio version is 2022 Community When I wanted to build a Strapi project, the better-sqlite3 package couldn't be installed. I tried my best but it didn't work. Who can help me? [enter image…
1
vote
2 answers

better-sqlite3 : I get undefined instead of the default values of the table

I expected to see the default of values set for the table, but I get undefined This is the code: import Database from 'better-sqlite3-multiple-ciphers' // https://gist.github.com/anhdiepmmk/b8dcd1c7be8c09580f607ef186529192 //…
Raphael10
  • 2,508
  • 7
  • 22
  • 50
1
vote
1 answer

cannot install better-sqlite3 with build-from-source because electron ABI mismatch

I want to update better-sqlite3 in my Electron App. Because of some lags between Nodejs, Electron and better-sqlit3 releases, I need to manually install better-sqlite3 with this command : npm install better-sqlite3@latest --build-from-source…
1
vote
1 answer

SqliteError: file is not a database

Following the indications found here: Sqlite Error: file is not a database I double-checked that the path does not contain .db extension: export const getInfopiecesDbpath = () { const isEnvDevelopment = process.env.NODE_ENV === 'development' …
Raphael10
  • 2,508
  • 7
  • 22
  • 50
1
vote
1 answer

Updating item in array of objects in Vue.js: is it better to replace the array or change one value

I'm using Vue/Vuex to generate components from an array with this structure (retrieved from SQLite using better-sqlite3). let table=[ { id:1, column_1:'data', column_2:'data', column_3:{'1':'data','2':'data','3':'data'} }, { …
Nico
  • 129
  • 11
1
vote
1 answer

select query for one-to-many relations table?

I have 2 tables. These two tables have one-to-many relations. TABLE - A column1 column2 1 label1 2 label2 TABLE - B Bcolumn1 Bcolumn2 Bcolumn3 1 value1 value4 1 value2 value5 2 value3 value6 RESULT…
Yash
  • 211
  • 2
  • 14
1
vote
2 answers

select query for one-to-many relations table

I have 2 tables. These two tables have one-to-many relations. TABLE - A column1 column2 1 label1 2 label2 TABLE - B Bcolumn1 Bcolumn2 Bcolumn3 1 value1 value4 1 value2 value5 2 value3 value6 RESULT…
Yash
  • 211
  • 2
  • 14
1
vote
0 answers

Discord.js v.13 | Can't insert into database

I want to add info to database and I'm getting the "This interaction failed" error in discord Using better-sqlite3, discord.js v13 For the code, I've used bits and pieces of tutorials and guides from around the internet and I think some of that may…
Farn
  • 13
  • 2
1
vote
1 answer

How to use better-sqlite3 with electron-react-boilerplate

Consider this example created by using the following steps: git clone --depth=1 https://github.com/electron-react-boilerplate/electron-react-boilerplate.git better-sqlite3-test cd better-sqlite3-test yarn cd ./release/app yarn add better-sqlite3 cd…