Questions tagged [node-sqlite3]

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

More info:

278 questions
1
vote
1 answer

Rows is not Iterable Error in EJS response

Hello I am getting an error in my EJS response file I am trying to display my form data that makes a request to my database on the server side and I am getting this error here is the Form Code and the Server side
swift gaming
  • 142
  • 4
1
vote
1 answer

What is the best way to INSERT multiple rows in a SQLite table

My problem mainly is performance related, I have this code running on the main ElectronJS proccess : ipcMain.handle('add_product', async (event, args)=>{ return new Promise((resolve, reject)=>{ try { …
Spetsz_
  • 21
  • 3
1
vote
1 answer

How to use Prepared statements with npm sqlite library on node js

I am using this library for connecting my node js application to an sqlite database. I saw its documentation for how to use prepared statements here but it is very brief and I cannot understand how to use it for my use case. Lets say I have an sql…
1
vote
2 answers

Modified data when using sqlite3

I'm a discord bot developer and I use an SQLite database for my bot. I installed sqlite3 by npm command and I worked with it, there was no problem, but now I can't use it because it modifies values. I have a bit of code here: const ghostChannels =…
Zitta
  • 74
  • 7
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
0 answers

js sqlite3 gwait until the db returned all data before returning it to another function

what i want: 1 - client request data 2 - server.js requests dbcontroller.js for data 3 - dbcontroller.js requests db for data 4 - db returns data to db controller 5 - dbcontroller returns the data to server.js 6 - server.js responds with data to…
1
vote
0 answers

DB malformed after downloading it from S3 bucket

I have a .db file stored in an S3 bucket. I am trying to download it to a project so I can use it for a SQLite DB. THe problem is that when I download it and use it I get the next error: SQLITE_CORRUPT: database disk image is malformed When I try…
1
vote
1 answer

Select SQLite Rows with First Timestamp after 1am of each day using Nodejs

Using nodejs with the node-sqlite3 library and given a sqlite table with a column timestamp that contains a timestamp string, such as: +-----------------------------------+--------+ + | timestamp | score | ....…
Athena Wisdom
  • 6,101
  • 9
  • 36
  • 60
1
vote
1 answer

SQLite3 JSON1 Order by numeric index

I have a table like this: TestTable --------- data (TEXT) All data values are JSON objects like { a:1, b:2, c:3 }. I want to be able to query the database and ORDER BY data->b DESC without a full table scan (indexed). Is this possible in SQLite…
Lucien
  • 776
  • 3
  • 12
  • 40
1
vote
1 answer

how to fix npm install sqlite3 error on mac?

I'm trying to install sqlite3 with npm on mac however the following error follows npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions…
ryan
  • 69
  • 1
  • 9
1
vote
1 answer

SQLite Syntax Error near "RETURNING" (Node)

I got a Node script with an Express server, im trying to insert a new entry into a Table. If got folloing setup: db.run('CREATE TABLE lists(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL)'); ... db.get(`INSERT INTO lists (name) VALUES (?)…
Sifi_crafter
  • 99
  • 1
  • 7
1
vote
1 answer

Get array with JOINed values

I'm using SQLite3 on NodeJS and have a database in memory with a relation between table1 and table2. fk field in table2 is id in table1. table1 : id value1 value2 1 v1_t1 v2_t1 table2 : id value1 fk 1 v1_t2 1 2 v2_t2 1 When…
J.F.
  • 13,927
  • 9
  • 27
  • 65
1
vote
0 answers

Is sharing one SQLite connection inside desktop app safe? Sharing one connection vs creating new connections for each query

I have found similar question on stackoverflow but it is solely focused on performance and answer is pretty obvious: creating new connection for each query = slower performance (how much slower? it depends) I am more worried about transaction…
hdw3
  • 871
  • 10
  • 28
1
vote
0 answers

How to use a sqlite3 database in an ejs file with node.js?

I have been able to connect to my sqlite3 database with node.js, I want to use the information from the records in a separate ejs file (index.ejs). Does anyone know if this is possible? code: //register sqlite3 const sqlite3 =…
ryan
  • 69
  • 1
  • 9
1
vote
1 answer

How do I return a value from a row by querying a sqlite3 database?

I am writing some database middleware for some expressjs app that is based on sqlite3. This is my directory structure: | app | database index.js | routes index.js database/index.js…
Lakshaya U.
  • 1,089
  • 1
  • 5
  • 21