Questions tagged [sql.js]

sql.js is a port of SQLite to JavaScript

sql.js is a port of SQLite to JavaScript, allowing full SQLite usage to be used in the web browser, Node apps, etc.

44 questions
2
votes
2 answers

Error: both async and sync fetching of the wasm failed

I am developing hybrid app in IONIC4. using typeorm for database. Geeting error core.js:9110 ERROR Error: Uncaught (in promise): abort("abort(\"both async and sync fetching of the wasm failed\"). Build with -s ASSERTIONS=1 for more info."). Build…
Nitin Karale
  • 789
  • 3
  • 12
  • 34
2
votes
2 answers

How to do a simple insert into the local database file sqlite with javascript

I try to insert data into a local database sqlite. Its possible. I can do it . But I have to create a new table every time. I try to do it without creating a new table... I already insert the data into the table but I had to create a table every…
2
votes
1 answer

Create new sql.js database using TypeScript

I'm trying to migrate my js code into typescript. One of the libs I use is sql.js. Successfully installed corresponding typing for it, but am blocked with creation of the database. How it was in JS: var db = new SQL.Database(); db.run('CREATE…
Ulad Melekh
  • 924
  • 3
  • 17
  • 33
2
votes
1 answer

Module name "fs" has not been loaded yet for context error in NodeJs

I have been trying to use sql.js with NodeJs using WebStorm. I configured the NodeJs in WebStorm and tried running this code. Database Test
user5799177
2
votes
0 answers

Persisting a Modified Database in Chrome APP using chrome.storage API

I am using SQL.js for SQLite in my chrome app , I am loading external db file to perform query , now i want to save my changes to local storage to make it persistent , it is already define…
Ahtisham
  • 216
  • 2
  • 13
1
vote
1 answer

Syntax error in Node module : Sql2: unexpected token

I am writing this basic code to connect to sql2: const mysql = require('mysql2'); var con = mysql.createConnection({ host: "localhost", user: "abc", password: "123", database: "test" }); con.connect(function (err) { if (err)…
1
vote
0 answers

Null sql.js DB instance in React context provider

I want to run a local-first app, so node.js is not available. I try to provide a sqljs database via context provider. I mostly times get the error TypeError: Cannot read properties of null (reading 'exec') The code looks as…
pg0
  • 54
  • 1
  • 7
1
vote
0 answers

How can I load a wasm file under node_modules as asset in snowpack?(for sql.js)

I want to use the sql.js library, which uses wasm to provide sql support in browser. To use this library in a React project, sql.js recommends using craco.js to extend the webpack config in CRA and use the file-loader package of webpack to fetch the…
Sri
  • 242
  • 3
  • 13
1
vote
0 answers

SQL.js Instead of creating a new sql database , access a file.sql

I need help (Problem inside code.) var db = new SQL.Database(); //instead of creating a new Database , i want to access one. db.run("CREATE TABLE todos (id INTEGER PRIMARY KEY AUTOINCREMENT, item TEXT);");```
Mr. Lima
  • 33
  • 8
1
vote
2 answers

Cannot load wasm URL scheme file is not supported

I am trying to learn how to use sql.js from here. https://sql.js.org/#/ I am following there first html example and I keep coming across errors just trying to run this. I installed sql.js using npm install sql.js I took the dist folder from the…
user16451367
1
vote
0 answers

How to display sqlite data in HTML

I am currently looking for a solution to display my data from a SQLite database in a HTML layout. I do link the idea of reveal.js and would like to use this or any similar solution as a form for data presentation. For the first step I do want to…
Nears
  • 11
  • 4
1
vote
1 answer

Using sql.js to display a SQLite .db in HTML page

I am trying to take a sqlite database (ex. data.db) and display in a HTML page. If I can display in table that would be great. But right now, I just want to see the data. I have tried everything I could find thus far. I am using sql.js as the…
1
vote
1 answer

loading sqlite database in javascript with sql.js

Can someone provide a simple complete example of loading an existing sqlite database not using node.js. Assume that the sql db is sitting in same location as index.html example: I tried this example but "contents" is undefined. Also, I would not…
mayowawa
  • 13
  • 1
  • 5
1
vote
1 answer

"handleError is not a function" error running sql.js

I'm trying to implement a REST environment in which, on the client side, client data is stored in a SQLite database. I have accomplished this before on Cordova using Cordova-sqlite-storage, but I'm unable to accomplish the same using its vanilla-JS…
hodgef
  • 1,416
  • 2
  • 19
  • 31
0
votes
1 answer

SQL.js write to file, no persistence?

I want to make a basic website with a local persistent database. I'm using sql.js but it seems that it's saving the data to webstorage instead of the .db file. Is my code wrong or is sql.js. Is sql.js not the right tool for this job or is my code…
Trax
  • 1,445
  • 5
  • 19
  • 39
1
2 3