Webkit download pre-built database

I have a rather large db (as in many records). I'd rather let the client download a pre-built db instead of forcing them to load a bunch of text, then insert all the records before being able to use the db.

The closest thing to a spec I can find is this: https://developer.apple.com/library/content/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/UsingtheJavascriptDatabase/UsingtheJavascriptDatabase.html

It doesn't mention anything about being able to download a database, but I thought someone on SO might have a solution.

Answers


Just make up the DB on the simulator or via some GUI... Then make the DB available on the web via a link to the DB file on your webserver. Then in the app check a flag that you make up to see if it has downloaded the DB yet, if it hasn't then just download the DB just like any other file over HTTP and store it in your documents directory. Then set your flag so you know you have downloaded the DB and that the app doesn't need to do this again. Then when you need to access the DB just point sqlite to the DB file you placed in the Documents directory.


Need Your Help

Why are cellspacing and cellpadding not CSS styles

html css html-table cellpadding cellspacing

I don't know why this bothers me so much, but when I create websites, I always try to do all my styling with CSS. However one thing I always have to remember to do when I'm working with tables is ...

Working of free() in C

c linked-list free

I have some trouble understanding on how the free() function in C works. What is think free() does is, as the name says, free the memory at the address which was passed as an argument. Then i tried...