Questions tagged [node-sqlite3]

`node-sqlite3` is an asynchronous, non-blocking SQLite3 bindings module for Node.js.

More info:

278 questions
-1
votes
1 answer

Calcuation from columns inside select statement

I have a sqlite3 table ACCOUNTS which contains four columns NAME, SCORE, START_TIME and CURRENT_TIME. START_TIME and CURRENT_TIME are in milliseconds (since 1970). Now I would like to calculate from each row the SCORE / ((CURRENT_TIME - START_TIME)…
machinery
  • 5,972
  • 12
  • 67
  • 118
-1
votes
1 answer

Updating integer values in SQLite3

Is there any way to make this piece of SQLite3 code shorter & more efficient? I'd like to add integers to an existing integer in a column. I've tried the code below. (db is defined as my SQLite3 db connection) db.all(`SELECT * FROM coins WHERE…
haste
  • 99
  • 5
-2
votes
1 answer

Using sqlite3 in node.js with already installed sqlite driver

I'm currently developing for an embedded system. It already has sqlite3 pre-installed: root@xxx-imx6-r1:/# sqlite3 -version 3.38.5 2022-05-06 15:25:27 78d9c993d404cdfaa7fdd2973fa1052e3da9f66215cff9c5540ebe55c407d9fe How can I use this sqlite3…
André Fiedler
  • 1,093
  • 4
  • 16
  • 25
-2
votes
1 answer

How to access variable outside of query block?

I want to use the for loop outside of the query but it is printing empty. sql = 'SELECT * FROM people'; let currMarker = []; db.all(sql, [], (err,rows) => { if (err) return console.error(err.message); currMarker = rows; for (let i…
redfries
  • 7
  • 3
-2
votes
2 answers

sqlite3 select records from multiple tables

I am a little stuck on a fairly simple sqlite query - perhaps because I've been looking at the issue for several hours and need a break. I have 2 tables (lets assume transactions only deals with incoming funds for now): db.run(`CREATE…
Husman
  • 6,819
  • 9
  • 29
  • 47
-2
votes
3 answers

node.js says it can't find sqlite3 module

I am using to create a todo-app backend using Sqlite3 and Node.js express framework. When I enter yarn start or npm start it gives an error as follows,I cannot understand what should I do for this error internal/modules/cjs/loader.js:883 throw…
-2
votes
1 answer

Update SQLite row with certain number

I have a problem that I can't solve with better-sqlite3 on node.js I have a table looking somewhat like this: image of table How can I change each rows xp, that has a level of 3 to 100? So in this example it should change id's 1 and 4 xp value to…
-3
votes
1 answer

Why i'm getting and error while sending email data to my database?

So my probleme is that i'm getting this error: Uncaught Error: SQLITE_ERROR: near "@gmail": syntax error while i'm INSERTING or UPDATING in the database. I'm working with sqlite3 and electron. Here is my code: function addPatient(){ var req =…
Lucas B
  • 1
  • 5
1 2 3
18
19