Questions tagged [node-sqlite3]

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

More info:

278 questions
2
votes
1 answer

SQLite 3 returning undefined value after inserted

I am developing electron app with sqlite 3 Database. I would like to get Last inserted ID after save data in database. i have run below query but call result always showing undefined. can anybody help me to solve this issue? db.run(`INSERT INTO …
Shafeeque OT
  • 83
  • 1
  • 8
2
votes
0 answers

Unable to open sqlcipher db file with knex electron

my approach to creating and using an sqlite3 encrypted database. 1_ create an encrypted db file using the ubuntu package sudo apt-get install sqlcipher. 2_ setting PRAGMA key = 'secret'. 3_ in electron : const myDBConfig = { client:…
Aimen Kaa
  • 59
  • 8
2
votes
0 answers

sqlite3 database opening in Electron

I have no problems in importing sql3 in my Electron-React-Typescript-Webpack app: import sqlite3 from 'sqlite3'; But when I add these lines in main.ts : const sql3_cb = () => { console.log("Welcome to sql3"); } app.on('ready', async () => { …
Raphael10
  • 2,508
  • 7
  • 22
  • 50
2
votes
0 answers

How best to create unit tests (using Mocha, Chai) for a Sequelize function such as .findAll()

I am in a programming bootcamp and we are currently learning about fullstack JavaScript. We are using the Express framework and I have opted to use a SQLite3 database. This is a basic app for maintaining books at a local community center. I am…
2
votes
0 answers

Node-SQLite3 In-Memory-DB: initialize from file and write back to file

The In-Memory-DB should be initialized/loaded from the filesystem DB. Later the In-Memory-DB should be written back to the filesystem. What is the best approach here? Should I "simply" copy the tables, or is there an other way? Please ignore the…
Chriss
  • 5,157
  • 7
  • 41
  • 75
2
votes
1 answer

Knex asking for install sqlite3 but I'm using mysql database

I'm trying to make a query on my local MySQL database, but when I use the knex it says for me to install the driver of sqlite3 which I don't need because my database is a MySQL. I tried to install the drive of sqlite3 just to see if it would fix my…
Denis Ximenes
  • 351
  • 3
  • 12
2
votes
0 answers

Electron and sqlite3 issue after packaging app on windows

I'm working on a simple app with electron and sqlite3 database. Everything is working fine until I package the app, I'm getting the following error. sqlite3 module not found I have tried everything from the old question and answers…
Project.X
  • 21
  • 3
2
votes
1 answer

NodeJs How to export a SQLite connection

I'm running an express app, in which I want to initialise/open a DB connection before I start listening on a port. server.js: const express = require('express'); const morgan = require('morgan'); const db =…
Martin
  • 1,159
  • 10
  • 34
2
votes
0 answers

Sqlite3 causing error: Module did not self-register

I'm having trouble with sqlite3 in my js project. I'm new to node, npm and coding in general. The full error message: Module did not self-register: './node_modules/sqlite3/lib/binding/node-v72-darwin-x64/node_sqlite3.node'.  at…
AndyOh
  • 87
  • 1
  • 9
2
votes
1 answer

Error: Cannot find module \node_modules\sqlite3\lib\binding\electron-v8.0-win32-x64\node_sqlite3.node'

I have trouble with installing sqlite3 in electron 8.1 I got following errors Error: Cannot find module 'D:\TASK(2020.1.1~)\AMS\node_modules\sqlite3\lib\binding\electron-v8.1-win32-x64\node_sqlite3.node' Require stack: -…
Lee Bin
  • 49
  • 3
  • 10
2
votes
1 answer

Using sqlite3 in an Angular + Electron app: Critical dependency: the request of a dependency is an expression

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 sqlite3 using: npm install sqlite3 npm install --save-dev @types/sqlite3 And I've tried to use it…
Francesco Borzi
  • 56,083
  • 47
  • 179
  • 252
2
votes
1 answer

KnexJs - Sqlite3 On Delete cascade doesn't work

i'm trying to make onDelete('CASCADE') work on knex js but it doesn't seem to work at all. Here's my knexjs migrations : const tableName = 'users' exports.up = function(knex) { return knex.schema.createTable(tableName, table => { …
user7616817
  • 357
  • 4
  • 18
2
votes
0 answers

How to use knex with sqlite in a vue-electron app

I'm searching some tutorial to setup a vue-electron(I'm using the vue-electron plugin) app with sqlite3 and knex. dependency sqlite in package.json here some configs from my vue.config.js to initiate module.exports = { transpileDependencies:…
fefe
  • 8,755
  • 27
  • 104
  • 180
2
votes
0 answers

Cross compile package using crossscript in yocto for node-sqlite3?

my yocto setup has nodejs recipe. Which works properly. I'm trying to cross-compile node-sqlite3 package by adding new recipe. node-sqlite3 depends on node-gyp script. script uses command node(machine-image). Build setup trying to use HOST path…
GBiradar
  • 161
  • 1
  • 11
2
votes
3 answers

Route returning empty array even though inserting into db seems to be working

I'm learning how to use Sqlite3 with Node, and I'm running into a strange issue. In componentWillMount() on my react front end's main App.js, I make an axios request to the route /all so I can populate a contact list. What's weird is that, when I…
Mike
  • 135
  • 6
1 2
3
18 19