Is it possible to open a Sqlite database using Javascript and not use anything but HTML5?

I am trying to create an application that works on any mobile device but does not require internet. I want to have a Sqlite database that I can query. I found a script, but it creates a WebSQL database in the browser. I want to request a flatfile file. Is it possible?

Here is my code:

function createDatabase() { try{ if (window.openDatabase) { var db; var shortName = 'configurator.sqlite'; var version = '1.0'; var displayName = 'configurator'; var maxSize = 65335; db = openDatabase(shortName, version, displayName, maxSize); } else { console.log('failure'); } } catch(e) { alert(e); } } 
+4
source share
2 answers

The question is to ask someone who can provide a tutorial for querying FlatFile DB, not the web db embedded in the browser. All of your links provide a web database tutorial that clearly emphasizes the question.

I think you should research SQL.JS on Github to get a solution of what you want. It is somewhat dependent on Node.js, but you will achieve your goal just fine.

+2
source

Source: https://habr.com/ru/post/1439898/


All Articles