4

I'm trying to create an application that works on any mobile device, but doesn't require internet. I want to have an Sqlite database that I can query. I found a script, but it creates a WebSQL database in the browser. I want to query the flatfile. Is that even 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);
    }
}
3
  • so you do or dont want to use WebSQL? Commented Oct 15, 2012 at 20:05
  • WebSQL has been deprecated. I want to use something else. Is Indexed DB my only choice? I want to work with the SQLite file. Commented Oct 15, 2012 at 20:06
  • 2
    as you stated WebSQL, the implementation of SQLite in Web Browser, is deprecated, so if you really need to use that format i can only suggest to use this SQL.js Commented Oct 15, 2012 at 20:18

2 Answers 2

2

Yes, Its possible. Try the following links

Sign up to request clarification or add additional context in comments.

4 Comments

Those are WebSQL, which has been deprecated.
Is HTML5 localStorage a solution for you?
I wanted something where it was relational, and I don't believe HTML5 localStorage is.
Yes, you are right. localStorage is not relational just a key-value pair. I doubt there is any other solution that will work in all browser at that moment. You can think of IndexedDB but I think its supported only in FF and Chrome.
2

The question is asking for someone who can provide a tutorial to query a FlatFile DB and not a web db embedded within the browser. All your links are providing tutorial on Web DB which the question clearly highlights.

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

1 Comment

This is better-suited as a comment, since it doesn't provide a concrete answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.